设置 psycopg2(PostGreSQL/python 数据库)时遇到问题
嘿,我对 Linux 还很陌生(使用 Ubuntu 11.04),所以请耐心等待。
我从 http://linux.softpedia 下载了 psycopg2 2.4.1。 com/get/Database/Database-APIs/psycopg-6404.shtml
然后我尝试运行...
python setup.py install
..虽然在目录中,但它告诉我..
错误:找不到pg_config可执行文件。
请将包含pg_config的目录添加到PATH中 或使用选项指定完整的可执行路径:
python setup.py build_ext --pg-config /path/to/pg_config build ...
... 我不知道如何到达 pg_config 的路径(我什至找不到它)。
感谢您的任何帮助。
Hey, I'm pretty new to linux (using Ubuntu 11.04) so bear with me here.
I downloaded psycopg2 2.4.1 from http://linux.softpedia.com/get/Database/Database-APIs/psycopg-6404.shtml
Then I try running...
python setup.py install
..While in the directory but then it tells me..
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 ...
... and I don't know how to get to the path of pg_config (and I can't even find it).
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您找到
pg_config
,或者在
PostgreSQL
安装的任何位置转储了pg_config
文件,这里有一个简单的解决方案。Here's an easy solution if you find your
pg_config
:Or wherever your installation of
PostgreSQL
dumped off yourpg_config
file.您可能没有安装它。我这样做了:
似乎有效。
您不通过 apt-get 安装 Psychopg 有什么原因吗?因为这可能是最简单的解决方案:
仅供参考,许多 python 包都可以通过 apt-get 安装,唯一要记住的是它们通常有一个 python- 前缀-- 如
python-nltk
、python-qt4-dev
等。You probably don't have it installed. I did this:
Seemed to work.
Is there a reason you aren't installing psychopg via
apt-get
though? Because this would probably be the easiest solution:FYI, many python packages are installable via
apt-get
, and the only thing to remember is that they generally have apython-
prefix -- as inpython-nltk
,python-qt4-dev
, and so on.