试图在New Ubuntu上安装psycop,我遇到了编译错误

时间:2011-10-28 20:55:24

标签: psycopg2

服务器是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**

欢迎任何帮助。

2 个答案:

答案 0 :(得分:1)

请勿使用--compiler=mingw32

您需要的只是python setup.py install

答案 1 :(得分:0)

-mno-cygwin和-mdll看起来像是在Windows上编译的选项,这很奇怪