简体   繁体   English

无法在Maverick上安装psycopg2

[英]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. 我正在尝试在Mac OS X Mavericks上安装psycopg2 ,但没有看到任何pg_config文件。

Postgres was installed via Postgres.app . Postgres是通过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 . 我在/Applications/Postgres.app/Contents/MacOS/bin/找到了pg_config并将其放置到setup.cfg但仍然无法安装psycopg2

What might be wrong? 可能是什么问题?

I had the same problem when I tried to install psycopg2 via Pycharm and using Postgres93.app. 当我尝试通过Pycharm并使用Postgres93.app安装psycopg2时,我遇到了同样的问题。 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. 安装程序(在Pycharm中运行时)坚持认为,尽管pg_config在我的路径上,但找不到pg_config文件,而且我可以在Terminal中成功运行pg_config和psql。 For me the solution was to install a clean version of python with homebrew. 对我来说,解决方案是使用Homebrew安装一个干净的python版本。 Navigate to the homebrew installation of Python and run pip in the terminal (rather than with Pycharm). 导航到Python的自制软件安装,然后在终端中运行pip(而不是使用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. 在Pycharm中运行的pip似乎没有在我的PATH上看到postgres安装,但是直接在终端中运行pip解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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