2013-06-27 109 views
1

當我嘗試在Mac上使用「pip install psycopg2」安裝psycopg2時,我收到了權限錯誤。以下是截圖:嘗試在Mac上使用「pip install psycopg2」安裝psycopg2時的權限錯誤

下載/拆包psycopg2 運行setup.py egg_info的包psycopg2

安裝收集包:psycopg2 運行的setup.py安裝psycopg2 建設 'psycopg2._psycopg' 延伸 /應用程序/ X代碼。 a p p/C o n t t n t s/D e v e l o p e r/T o o l c a n s s/X c d e d e f a u l t t。 xctoolchain/usr/bin/clang - fno - strict - aliasing - fno - common - dynamic - archi 3 8 6 - archx 8 6 _ 6 4 - g - O 2 - DNDEBUG - g - O 3 - DPSYCOPG_DEFAULT_PYDATETIME = 1 - DPSYCOPG_VERSION = 「2.5.1(dt dec pq3 ext)」-DPG_VERSION_HEX = 0x090105 -DPSYCOPG_EXTENSIONS = 1 -DPSYCOPG_NEW_BOOLEAN = 1 -DHAVE_PQFREEMEM = 1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I。 -I/usr/include -I/usr/include/postgresql/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.6-intel-2.7/psycopg/psycopgmodule.o 無法執行/:Permission denied error:command'/'failed with exit status 1 Complete command from command /Users/[email protected]/venv/python_venv/bin/python -c「import setuptools; file ='/ Users/ivy .jia @ canarie.local/venv/python_venv/build/psycopg2/setup.py'; exec(編譯(打開(文件).read()。replace('\ r \ n','\ n'), file'exec'))「install --record /tmp/pip-O7Ov2u-record/install-record.txt --single-version-external-managed --install-headers /Users/[email protected] .local/venv/python_venv/bin /../ include/site/python2.7: running install

運行建立運行build_py

運行build_ext

建設 'psycopg2._psycopg' 延伸

/的p p L I C A T I O 4 N S/X C 0 dé

。 a p p/C o n t t n t s/D e v e l o p e r/T o o l c a n s s/X c d e d e f a u l t t。 xctoolchain/usr/bin/clang - fno - strict - aliasing - fno - common - dynamic - archi 3 8 6 - archx 8 6 _ 6 4 - g - O 2 - DNDEBUG - g - O 3 - DPSYCOPG_DEFAULT_PYDATETIME = 1 - DPSYCOPG_VERSION = 「2.5.1(dt dec pq3 ext)」-DPG_VERSION_HEX = 0x090105 -DPSYCOPG_EXTENSIONS = 1 -DPSYCOPG_NEW_BOOLEAN = 1 -DHAVE_PQFREEMEM = 1 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I。 -I/USR /包括-I/USR /包含/的PostgreSQL /服務器-c psycopg/psycopgmodule.c -o建立/ temp.macosx-10.6-Intel的2.7/psycopg/psycopgmodule.o

無法執行/ :權限被拒絕

錯誤:命令「/」與退出狀態

回答

2

失敗的各種需要C語言編譯程序包(GEVENT,zeromq等)似乎是PIP增加額外空間的命令,導致它失敗:

進入Xcode並顯式下載命令行工具(在首選項>下載下)。

來源: http://www.pressingquestion.com/5111217/Pip-Installation-Adds-Extra-Spaces-To-Command-On-Os-X-108

+0

是的,這對我的作品。這是cc編譯器的前綴編譯行: cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot/Applications/Xcode .app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk /System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes ... –