econchick / new-coder

New Coder tutorials
zlib License
597 stars 392 forks source link

How to use psycogs2 in scrape tutorial on 10.9? #77

Closed minthemiddle closed 10 years ago

minthemiddle commented 10 years ago

When trying to run pip install -r requirements.txtin the scrape tutorial on Mac OS X 10.9, the following error returns - and is obviously related to psycogs2:

Downloading/unpacking psycopg2==2.4.6 (from -r requirements.txt (line 5))
  Downloading psycopg2-2.4.6.tar.gz (667kB): 667kB downloaded
  Running setup.py egg_info for package psycopg2

    Error: pg_config executable not found.

    Please add the directory containing pg_config to the PATH
    or specify the full executable path with the option:

        python setup.py build_ext --pg-config /path/to/pg_config build ...

    or with the pg_config option in 'setup.cfg'.
    Complete output from command python setup.py egg_info:
    running egg_info

creating pip-egg-info/psycopg2.egg-info

writing pip-egg-info/psycopg2.egg-info/PKG-INFO

writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt

writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt

writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found

Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

----------------------------------------
Cleaning up...

Note that I do have gcc installed to compile, as gcc --version returns the following:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
minthemiddle commented 10 years ago

Well, I could solve it myself. I did another symlink and I could use pip afterwards:

sudo ln -s /Applications/Postgres93.app/Contents/MacOS/bin/pg_config /usr/bin/pg_config.

econchick commented 10 years ago

Ah I see. I think this warrants better setup how-to with the instructions on the new coder site. I've seen this before. Thanks!

On Dec 16, 2013, at 6:01 AM, Martin Betz notifications@github.com wrote:

Well, I could solve it myself. I did another symlink and I could use pip afterwards:

sudo ln -s /Applications/Postgres93.app/Contents/MacOS/bin/pg_config /usr/bin/pg_config.

— Reply to this email directly or view it on GitHub.