mac下安装pycurl报错的解决方法

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('\r\n', '\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即可

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容