尝试使用“pip install psycopg2”在Mac上安装psycopg2时出现权限错误

时间:2013-06-27 15:02:28

标签: psycopg2

当我尝试使用“pip install psycopg2”在Mac上安装psycopg2时,我收到了权限错误。以下是捕获:

下载/解压缩psycopg2   运行包psycopg2的setup.py egg_info

安装收集的软件包:psycopg2   运行psycopg2的setup.py安装     建立'psycopg2._psycopg'扩展     / A p p l i c a t i o s s / X c o d e。 a p p / C o n t e n t s / D e v e l o p e r / T o o l c i a s s / X c o d e d e f a u 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     无法执行/:权限被拒绝     错误:命令'/'失败,退出状态为1     命令/Users/ivy.jia@canarie.local/venv/python_venv/bin/python -c“import setuptools; file ='/ Users/ivy.jia@canarie.local/venv /python_venv/build/psycopg2/setup.py';exec(compile(open(file).read().replace('\\\','\ n'),文件,'exec'))“install --record /tmp/pip-O7Ov2u-record/install-record.txt --single-version-external-managed --install-headers /Users/ivy.jia @ canarie.local / VENV / python_venv / bin中/../包括/网站/ python2.7:     正在运行安装

运行构建

运行build_py

运行build_ext

建立'psycopg2._psycopg'扩展

/ A p p l t a t i o s s / X c o d e。 a p p / C o n t e n t s / D e v e l o p e r / T o o l c i a s s / X c o d e d e f a u 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

无法执行/:权限被拒绝

错误:命令'/'以退出状态

失败

1 个答案:

答案 0 :(得分:2)

对于需要c编译的各种包(gevent,zeromq等),似乎pip正在为命令添加额外的空格,导致它失败:

进入Xcode并明确下载命令行工具(在Preferences> Downloads下)。

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