2011-03-25 15 views
1

我想在virtualenv中安裝psycopg2,但似乎我沒有訪問gcc的權限。如何在似乎沒有gcc訪問權限的virtualenv中安裝psycopg2?

有沒有辦法從virtualenv內部激活gcc?如果沒有,是否還有其他與PostgreSQL協同工作的庫不使用gcc?

我試圖在A2hosting.com安裝psycopg2給了我這個錯誤:

running install 
running build 
running build_py 
creating build 
creating build/lib.linux-x86_64-2.4 
creating build/lib.linux-x86_64-2.4/psycopg2 
copying lib/errorcodes.py -> build/lib.linux-x86_64-2.4/psycopg2 
copying lib/__init__.py -> build/lib.linux-x86_64-2.4/psycopg2 
copying lib/extensions.py -> build/lib.linux-x86_64-2.4/psycopg2 
copying lib/pool.py -> build/lib.linux-x86_64-2.4/psycopg2 
copying lib/tz.py -> build/lib.linux-x86_64-2.4/psycopg2 
copying lib/psycopg1.py -> build/lib.linux-x86_64-2.4/psycopg2 
copying lib/extras.py -> build/lib.linux-x86_64-2.4/psycopg2 
creating build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/types_extras.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/types_basic.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_dates.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/bugX000.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_copy.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_async.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_notify.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/extras_dictcursor.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_lobject.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_connection.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_green.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/bug_gc.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/__init__.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_quote.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/testutils.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/dbapi20.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_cursor.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_cancel.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/test_transaction.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
copying tests/testconfig.py -> build/lib.linux-x86_64-2.4/psycopg2/tests 
running build_ext 
building 'psycopg2._psycopg' extension 
creating build/temp.linux-x86_64-2.4 
creating build/temp.linux-x86_64-2.4/psycopg 
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x080309 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.4 -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-2.4/psycopg/psycopgmodule.o -Wdeclaration-after-statement 
unable to execute gcc: Permission denied 
error: command 'gcc' failed with exit status 1 

UPDATE:

我發現,關於這一點我正在嘗試安裝psycopg2機器不有PostgreSQL。這個虛擬主機公司在另一臺服務器上安裝了PostgreSQL。在這種情況下可以做些什麼?

+0

我現在有這個非常託管相同的問題。你最終設法安裝了psycopg2嗎?如果是這樣,請分享你是如何做到的。 – Vasily 2015-01-10 23:16:04

回答

0

你不需要PostgreSQL,你需要PostgreSQL客戶端庫和開發文件。您可以嘗試讓主機安裝它們,否則您可以在類似的平臺上構建它並手動複製軟件包。

+0

環境安裝了Red Hat。我可以在Ubuntu中構建它嗎?當我複製/粘貼包裹時,我需要在Psycopg2中更改哪些設置?最好的祝福, – 2011-03-25 08:31:22

相關問題