MAC下安装pycurl  打开命令行执行:

sudo pip install pycurl -i https://pypi.tuna.tsinghua.edu.cn/simple

报错:

    1 warning generated.

    In file included from src/threadsupport.c:1:

    src/pycurl.h:190:5: warning: “libcurl was compiled with SSL support, but configure could not determine which ”      “library was used; thus no SSL crypto locking callbacks will be set, which may ”      “cause random crashes on SSL requests” [-W#warnings]

    #   warning

        ^

    1 warning generated.

    cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/docstrings.o build/temp.macosx-10.12-intel-2.7/src/easy.o build/temp.macosx-10.12-intel-2.7/src/module.o build/temp.macosx-10.12-intel-2.7/src/multi.o build/temp.macosx-10.12-intel-2.7/src/oscompat.o build/temp.macosx-10.12-intel-2.7/src/pythoncompat.o build/temp.macosx-10.12-intel-2.7/src/share.o build/temp.macosx-10.12-intel-2.7/src/stringcompat.o build/temp.macosx-10.12-intel-2.7/src/threadsupport.o -lcurl -o build/lib.macosx-10.12-intel-2.7/pycurl.so

    running install_lib

    copying build/lib.macosx-10.12-intel-2.7/pycurl.so -> /Library/Python/2.7/site-packages

    running install_data

    creating /System/Library/Frameworks/Python.framework/Versions/2.7/share

    error: could not create ‘/System/Library/Frameworks/Python.framework/Versions/2.7/share’: Operation not permitted

  —————————————-

Command “/usr/bin/python -u -c “import setuptools, tokenize;file=’/private/tmp/pip-build-thsXKy/pycurl/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘rn’, ‘n’);f.close();exec(compile(code, file, ‘exec’))” install –record /tmp/pip-2Geh3A-record/install-record.txt –single-version-externally-managed –compile” failed with error code 1 in /private/tmp/pip-build-thsXKy/pycurl/

网上查了下原因,要加上–user就好了

sudo pip install pycurl -i https://pypi.tuna.tsinghua.edu.cn/simple –user

这样就可以安装成功了。

备注:

将 pip 安装的包默认安装在用户目录。

说起来很简单,只需跟参数–user即可

文章来源于互联网,如有雷同请联系站长删除:mac下安装pycurl报错的解决方法

发表评论