尝试在新 Ubuntu 上安装 psycop 时遇到编译错误
服务器是 Ubuntu Lucid LTS
PostGreSql 是 8.4
这是我收到的错误:
root@:~/psycopg2-2.4.2# python setup.py install build --compiler=mingw32
running install
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
gcc -mno-cygwin -mdll -O -Wall -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2
(dt dec pq3 ext)" -DPG_VERSION_HEX=0x080409 -DPSYCOPG_EXTENSIONS=1
-DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6 -I.
-I/usr/include/postgresql -I/usr/include/postgresql/8.4/server
-c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.6/psycopg/psycopgmodule.o
-Wdeclaration-after-statement
**cc1: error: unrecognized command line option "-mno-cygwin"
cc1: error: unrecognized command line option "-mdll"
error: command 'gcc' failed with exit status 1**
欢迎任何帮助。
Server is Ubuntu Lucid LTS
PostGreSql is 8.4
This is the error I am getting:
root@:~/psycopg2-2.4.2# python setup.py install build --compiler=mingw32
running install
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
gcc -mno-cygwin -mdll -O -Wall -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.2
(dt dec pq3 ext)" -DPG_VERSION_HEX=0x080409 -DPSYCOPG_EXTENSIONS=1
-DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.6 -I.
-I/usr/include/postgresql -I/usr/include/postgresql/8.4/server
-c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.6/psycopg/psycopgmodule.o
-Wdeclaration-after-statement
**cc1: error: unrecognized command line option "-mno-cygwin"
cc1: error: unrecognized command line option "-mdll"
error: command 'gcc' failed with exit status 1**
Any help is welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要使用
--compiler=mingw32
。您所需要的只是
python setup.py install
。Don't use
--compiler=mingw32
.All you need is
python setup.py install
.-mno-cygwin 和 -mdll 看起来像是在 Windows 上编译的选项,这很奇怪
-mno-cygwin and -mdll look like options for compiling on Windows, which is odd