Как установить psycopg2 в virtualenv, который, кажется, не имеет доступа к gcc? - PullRequest
1 голос
/ 25 марта 2011

Я пытаюсь установить psycopg2 в virtualenv, но мне кажется, что у меня нет доступа к gcc.

Есть ли способ активировать gcc изнутри virtualenv? Если нет, то есть ли какая-либо другая библиотека, которая работает с PostgreSQL, которая не использует gcc?

Моя попытка установить psycopg2 на A2hosting.com выдает мне эту ошибку:

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 установлен на другом сервере Что можно сделать в такой ситуации?

1 Ответ

0 голосов
/ 25 марта 2011

Вам не нужен PostgreSQL, вам нужны клиентские библиотеки PostgreSQL и файлы для разработки. Вы можете попытаться попросить хост установить их, или вы не сможете собрать его на аналогичной платформе и скопировать пакет вручную.

...