简体   繁体   中英

Can't install psycopg2 on Maverick

I am trying to install psycopg2 on Mac OS X Mavericks but it doesn't see any pg_config file.

Postgres was installed via Postgres.app .

I found pg_config in /Applications/Postgres.app/Contents/MacOS/bin/ and put it to setup.cfg but still can't install psycopg2 .

What might be wrong?

I had the same problem when I tried to install psycopg2 via Pycharm and using Postgres93.app. The installer (when running in Pycharm) insisted it could not find the pg_config file despite the fact that pg_config is on my path and I could run pg_config and psql successfully in Terminal. For me the solution was to install a clean version of python with homebrew. Navigate to the homebrew installation of Python and run pip in the terminal (rather than with Pycharm). It seems pip running in Pycharm did not see the postgres installation on my PATH, but running pip directly in a terminal resolved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM