Mac OS python2.7
pip install pycurl
错误信息:
解决办法:在指令后加--user, 即pip install pycurl --user,执行即可
原因:--user指定将 pip 安装的包默认安装在用户目录,使用本地的SSL
$ pip install pycurl
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pycurl
Using cached https://files.pythonhosted.org/packages/ef/05/4b773f74f830a90a326b06f9b24e65506302ab049e825a3c0b60b1a6e26a/pycurl-7.43.0.5.tar.gz
Installing collected packages: pycurl
Running setup.py install for pycurl ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-fyZFzH/pycurl/setup.py'"'"'; __file__='"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-fyZFzH/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 /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-record-yVnPPs/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-fyZFzH/pycurl/
Complete output (185 lines):
Using curl-config (libcurl 7.54.0)
Warning: libcurl is configured to use SSL, but we have not been able to determine which SSL backend it is using. If your Curl is built against OpenSSL, LibreSSL, BoringSSL, GnuTLS, NSS or mbedTLS please specify the SSL backend manually. For other SSL backends please ignore this message.Not using an SSL library
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-intel-2.7
creating build/lib.macosx-10.14-intel-2.7/curl
copying python/curl/__init__.py -> build/lib.macosx-10.14-intel-2.7/curl
running build_ext
building 'pycurl' extension
creating build/temp.macosx-10.14-intel-2.7
creating build/temp.macosx-10.14-intel-2.7/src
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/docstrings.c -o build/temp.macosx-10.14-intel-2.7/src/docstrings.o
In file included from src/docstrings.c:4:
src/pycurl.h:213: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.
In file included from src/docstrings.c:4:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/easy.c -o build/temp.macosx-10.14-intel-2.7/src/easy.o
In file included from src/easy.c:1:
src/pycurl.h:213: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.
In file included from src/easy.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/easycb.c -o build/temp.macosx-10.14-intel-2.7/src/easycb.o
In file included from src/easycb.c:1:
src/pycurl.h:213: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.
In file included from src/easycb.c:1:
src/pycurl.h:213: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 \
^
src/easycb.c:215:26: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
int sockfd = PyInt_AsLong(fileno_result);
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/easycb.c:501:24: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
int ret_code = PyInt_AsLong(result);
~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~
3 warnings generated.
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/easyinfo.c -o build/temp.macosx-10.14-intel-2.7/src/easyinfo.o
In file included from src/easyinfo.c:1:
src/pycurl.h:213: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.
In file included from src/easyinfo.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/easyopt.c -o build/temp.macosx-10.14-intel-2.7/src/easyopt.o
In file included from src/easyopt.c:1:
src/pycurl.h:213: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.
In file included from src/easyopt.c:1:
src/pycurl.h:213: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 \
^
src/easyopt.c:595:23: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
val = PyLong_AsLong(PyListOrTuple_GetItem(httppost_option, j, which_httppost_option));
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/easyperform.c -o build/temp.macosx-10.14-intel-2.7/src/easyperform.o
In file included from src/easyperform.c:1:
src/pycurl.h:213: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.
In file included from src/easyperform.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/module.c -o build/temp.macosx-10.14-intel-2.7/src/module.o
In file included from src/module.c:1:
src/pycurl.h:213: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.
In file included from src/module.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/multi.c -o build/temp.macosx-10.14-intel-2.7/src/multi.o
In file included from src/multi.c:1:
src/pycurl.h:213: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.
In file included from src/multi.c:1:
src/pycurl.h:213: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 \
^
src/multi.c:852:22: warning: implicit conversion loses integer precision: 'long' to '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32]
tv.tv_usec = (long)(timeout*1000000.0);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/oscompat.c -o build/temp.macosx-10.14-intel-2.7/src/oscompat.o
In file included from src/oscompat.c:1:
src/pycurl.h:213: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.
In file included from src/oscompat.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/pythoncompat.c -o build/temp.macosx-10.14-intel-2.7/src/pythoncompat.o
In file included from src/pythoncompat.c:1:
src/pycurl.h:213: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.
In file included from src/pythoncompat.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/share.c -o build/temp.macosx-10.14-intel-2.7/src/share.o
In file included from src/share.c:1:
src/pycurl.h:213: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.
In file included from src/share.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/stringcompat.c -o build/temp.macosx-10.14-intel-2.7/src/stringcompat.o
In file included from src/stringcompat.c:1:
src/pycurl.h:213: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.
In file included from src/stringcompat.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/threadsupport.c -o build/temp.macosx-10.14-intel-2.7/src/threadsupport.o
In file included from src/threadsupport.c:1:
src/pycurl.h:213: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.
In file included from src/threadsupport.c:1:
src/pycurl.h:213: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 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.5" -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/util.c -o build/temp.macosx-10.14-intel-2.7/src/util.o
In file included from src/util.c:1:
src/pycurl.h:213: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.
In file included from src/util.c:1:
src/pycurl.h:213: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 -Wl,-F. build/temp.macosx-10.14-intel-2.7/src/docstrings.o build/temp.macosx-10.14-intel-2.7/src/easy.o build/temp.macosx-10.14-intel-2.7/src/easycb.o build/temp.macosx-10.14-intel-2.7/src/easyinfo.o build/temp.macosx-10.14-intel-2.7/src/easyopt.o build/temp.macosx-10.14-intel-2.7/src/easyperform.o build/temp.macosx-10.14-intel-2.7/src/module.o build/temp.macosx-10.14-intel-2.7/src/multi.o build/temp.macosx-10.14-intel-2.7/src/oscompat.o build/temp.macosx-10.14-intel-2.7/src/pythoncompat.o build/temp.macosx-10.14-intel-2.7/src/share.o build/temp.macosx-10.14-intel-2.7/src/stringcompat.o build/temp.macosx-10.14-intel-2.7/src/threadsupport.o build/temp.macosx-10.14-intel-2.7/src/util.o -lcurl -o build/lib.macosx-10.14-intel-2.7/pycurl.so -flat_namespace
running install_lib
copying build/lib.macosx-10.14-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
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-fyZFzH/pycurl/setup.py'"'"'; __file__='"'"'/private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-install-fyZFzH/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 /private/var/folders/mh/szrw8j2x4x9b73d8jmv1vb0m0000gn/T/pip-record-yVnPPs/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.