[英]Error installing psycopg2 in Ubuntu 12.04
I'm having some trouble installing psycopg2 into a virtualenv. 我在将psycopg2安装到virtualenv时遇到了一些麻烦。 Here is the output for
pip install psycopg2
. 这是
pip install psycopg2
的输出。
Note 1 : I checked a lot of StackOverflow answers and i installed all that *-dev packages suggested. 注1 :我检查了很多StackOverflow答案,并安装了所有建议的* -dev软件包。 Some hint here?
这里有一些提示吗?
Note 2 : I get same output from python setup.py install
on source. 注2 :我从源代码
python setup.py install
获得了相同的输出。
Downloading/unpacking psycopg2
Downloading psycopg2-2.5.1.tar.gz (684kB): 684kB downloaded
Running setup.py egg_info for package psycopg2
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.5.1 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x09010A -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.1/server -c psycopg/psycopgmodule.c -o build/temp.linux-i686-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from /usr/include/string.h:642:0,
from /usr/include/python2.7/Python.h:38,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/i386-linux-gnu/bits/string3.h: In function ‘memcpy’:
/usr/include/i386-linux-gnu/bits/string3.h:52:3: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccANjg96.out file, please attach this to your bugreport.
error: command 'gcc' failed with exit status 1
Complete output from command /webapps/sysacad_wrapper/bin/python -c "import setuptools;__file__='/webapps/sysacad_wrapper/build/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ixowrn-record/install-record.txt --single-version-externally-managed --install-headers /webapps/sysacad_wrapper/include/site/python2.7:
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/psycopg2
copying lib/tz.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/psycopg1.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/_json.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/extras.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/extensions.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/pool.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/errorcodes.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/_range.py -> build/lib.linux-i686-2.7/psycopg2
copying lib/__init__.py -> build/lib.linux-i686-2.7/psycopg2
creating build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_module.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_lobject.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_copy.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_with.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_cancel.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_connection.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_quote.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/dbapi20.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/testconfig.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/testutils.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_transaction.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_dates.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_async.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_notify.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_green.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/test_cursor.py -> build/lib.linux-i686-2.7/psycopg2/tests
copying tests/__init__.py -> build/lib.linux-i686-2.7/psycopg2/tests
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/psycopg
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.1 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x09010A -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.7 -I. -I/usr/include/postgresql -I/usr/include/postgresql/9.1/server -c psycopg/psycopgmodule.c -o build/temp.linux-i686-2.7/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from /usr/include/string.h:642:0,
from /usr/include/python2.7/Python.h:38,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/i386-linux-gnu/bits/string3.h: In function ‘memcpy’:
/usr/include/i386-linux-gnu/bits/string3.h:52:3: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccANjg96.out file, please attach this to your bugreport.
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /webapps/sysacad_wrapper/bin/python -c "import setuptools;__file__='/webapps/sysacad_wrapper/build/psycopg2/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ixowrn-record/install-record.txt --single-version-externally-managed --install-headers /webapps/sysacad_wrapper/include/site/python2.7 failed with error code 1 in /webapps/sysacad_wrapper/build/psycopg2
Traceback (most recent call last):
File "/webapps/sysacad_wrapper/bin/pip", line 9, in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
File "/webapps/sysacad_wrapper/local/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
return command.main(args[1:], options)
File "/webapps/sysacad_wrapper/local/lib/python2.7/site-packages/pip/basecommand.py", line 169, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 60: ordinal not in range(128)
I've already solved it. 我已经解决了 Upgrading gcc to 4.8.2 did the work.
将gcc升级到4.8.2完成了工作。 Thanks anyway.
不管怎么说,还是要谢谢你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.