免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3876 | 回复: 0
打印 上一主题 下一主题

求助!psycopg2无法安装 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-15 14:49 |只看该作者 |倒序浏览
我已经用ports安装好postgresql 8.4,以root用户执行pg_config得到结果如下:

BINDIR = /usr/local/bin
DOCDIR = /usr/local/share/doc/postgresql
HTMLDIR = /usr/local/share/doc/postgresql
INCLUDEDIR = /usr/local/include
PKGINCLUDEDIR = /usr/local/include/postgresql
INCLUDEDIR-SERVER = /usr/local/include/postgresql/server
LIBDIR = /usr/local/lib
PKGLIBDIR = /usr/local/lib/postgresql
LOCALEDIR = /usr/local/share/locale
MANDIR = /usr/local/man
SHAREDIR = /usr/local/share/postgresql
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--with-libraries=/usr/local/lib' '--with-includes=/usr/local/include' '--enable-thread-safety' '--with-openssl' '--with-system-tzdata=/usr/share/zoneinfo' '--enable-nls' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=i386-portbld-freebsd7.2' 'build_alias=i386-portbld-freebsd7.2' 'CC=cc' 'CFLAGS=-O2 -fno-strict-aliasing -pipe  -O3 -funroll-loops' 'LDFLAGS= -pthread -rpath=/usr/lib:/usr/local/lib'
CC = cc
CPPFLAGS = -I/usr/local/include
CFLAGS = -O2 -fno-strict-aliasing -pipe  -O3 -funroll-loops -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
CFLAGS_SL = -fPIC -DPIC
LDFLAGS = -pthread -rpath=/usr/lib:/usr/local/lib -L/usr/local/lib -Wl,--as-needed -Wl,-R'/usr/local/lib'
LDFLAGS_SL =
LIBS = -lpgport -lintl -lssl -lcrypto -lz -lreadline -lcrypt -lm
VERSION = PostgreSQL 8.4.0

然后,我试图去安装psycopg2:

cd /usr/ports/databases/py-psycopg2
make install clean

得到以下错误:

===>  Building for py26-psycopg2-2.0.11
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
cc -fno-strict-aliasing -DNDEBUG -O2 -fno-strict-aliasing -pipe -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.0.11 (dt dec ext pq3)" -DPG_VERSION_HEX=0x080400 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/usr/local/include/python2.6 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.freebsd-7.2-RELEASE-i386-2.6/psycopg/psycopgmodule.o
In file included from psycopg/psycopgmodule.c:23:
/usr/local/include/python2.6/Python.h:168:17: error: pth.h: No such file or directory
error: command 'cc' failed with exit status 1
*** Error code 1

Stop in /usr/ports/databases/py-psycopg2.

然后我再尝试使用源代码自己编译,尝试了0.8,0.9,0.10均无法成功,卸载pg8.4改为8.3也不行。

但是错误提示的pth.h存在于/usr/local/include/pth/目录下,我不清楚该如何指向,望高手能指点!

多谢!

BTW:所使用的操作系统是FreeBSD 7.2,Python是2.6

[ 本帖最后由 magic22cn 于 2009-7-17 14:58 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP