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即可