mac下安裝pycurl報錯的解決方法

MAC下安裝pycurl ?打開命令行執(zhí)行:

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/

網(wǎng)上查了下原因,要加上--user就好了

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

這樣就可以安裝成功了。

備注:

將 pip 安裝的包默認安裝在用戶目錄。

說起來很簡單,只需跟參數(shù)--user即可

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容