【问题标题】:Permission error when try to install psycopg2 on Mac with "pip install psycopg2"尝试使用“pip install psycopg2”在 Mac 上安装 psycopg2 时出现权限错误
【发布时间】:2013-06-25 03:57:45
【问题描述】:

当我尝试使用“pip install psycopg2”在 Mac 上安装 psycopg2 时,出现权限错误。以下为截图:

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

安装收集的包:psycopg2 为 psycopg2 运行 setup.py install 构建“psycopg2._psycopg”扩展 / A p p l i c a t i o n 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 h a i n s / X c o d e D e f a u l 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('\r\n', '\n'), 文件, 'exec'))" install --record /tmp/pip-O7Ov2u-record/install-record.txt --single-version-externally-managed --install-headers /Users/ivy.jia @canarie.local/venv/python_venv/bin/../include/site/python2.7: 运行安装

运行构建

运行 build_py

运行 build_ext

构建“psycopg2._psycopg”扩展

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

无法执行/:权限被拒绝

错误:命令“/”失败,退出状态

【问题讨论】:

    标签: psycopg2


    【解决方案1】:

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

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

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

    【讨论】:

    • 是的,这对我有用。这会在编译行前面加上 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 ...
    猜你喜欢
    • 2020-09-01
    • 2020-12-11
    • 2014-12-30
    • 2012-07-17
    • 2016-04-07
    • 1970-01-01
    • 2018-09-23
    • 1970-01-01
    相关资源
    最近更新 更多