在 virtualenv 中安装 psycopg2(Ubuntu 10.04,Python 2.5)
我在 virtualenv 中安装 psycopg2 时遇到问题。
我尝试了那里解释的不同事情: http://www .saltycrane.com/blog/2009/07/using-psycopg2-virtualenv-ubuntu-jaunty/
我尝试的最后一件事是......
我使用 -p python2.5 --no-site-packages
创建了一个 virtualenv 我安装了 libpq-dev: apt-get install libpq-dev
在 virtualenv 中,我这样做了: easy_install -i http://downloads.egenix.com/python/index/ucs4/ egenix-mx-base
然后当我尝试 pip install 时psycopg2==2.0.7
,我收到此错误:
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.2 (dt dec ext pq3)" -DPG_VERSION_HEX=0x080404 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/usr/include/python2.5 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/psycopgmodule.c -o build/temp.linux-i686-2.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement
psycopg/psycopgmodule.c:27:20: error: Python.h: No such file or directory
In file included from psycopg/psycopgmodule.c:31:
./psycopg/python.h:31:26: error: structmember.h: No such file or directory
./psycopg/python.h:34:4: error: #error "psycopg requires Python >= 2.4"
In file included from psycopg/psycopgmodule.c:32:
有人知道如何解决这个问题吗?
谢谢。
I had problems installing psycopg2 in a virtualenv.
I tried different things explained there: http://www.saltycrane.com/blog/2009/07/using-psycopg2-virtualenv-ubuntu-jaunty/
The last thing I tried is this...
I created a virtualenv with -p python2.5 --no-site-packages
I installed libpq-dev: apt-get install libpq-dev
In the virtualenv, I did this: easy_install -i http://downloads.egenix.com/python/index/ucs4/ egenix-mx-base
Then when I tried pip install psycopg2==2.0.7
, I got this error:
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.2.2 (dt dec ext pq3)" -DPG_VERSION_HEX=0x080404 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/usr/include/python2.5 -I. -I/usr/include/postgresql -I/usr/include/postgresql/8.4/server -c psycopg/psycopgmodule.c -o build/temp.linux-i686-2.5/psycopg/psycopgmodule.o -Wdeclaration-after-statement
psycopg/psycopgmodule.c:27:20: error: Python.h: No such file or directory
In file included from psycopg/psycopgmodule.c:31:
./psycopg/python.h:31:26: error: structmember.h: No such file or directory
./psycopg/python.h:34:4: error: #error "psycopg requires Python >= 2.4"
In file included from psycopg/psycopgmodule.c:32:
Does anyone have any idea how to solve that?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 python 列表:
From python-list: