Mac下安装pycurl填坑记录

为日后使用方便,特此记录

本文是安装在以下环境中
macos high sierra 10.13.5
python 2.7
pip 18.0

原文地址:https://www.jianshu.com/p/61fd0c16aef4

缘由

因为工作需要,所以要从Windows项目迁移至MAC中,在安装项目环境时候发现pycurl的安装网上资料有些乱,导致安装了两三小时才安装完成。特此记录

使用上面命令安装,排除pip超时的情况下,大多遇见如下两种错误情况:

错误一

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pycurl
  Downloading http://mirrors.aliyun.com/pypi/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz (214kB)
    100% |████████████████████████████████| 215kB 1.9MB/s
    Complete output from command python setup.py egg_info:
    Using curl-config (libcurl 7.54.0)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-M7SSJd/pycurl/setup.py", line 913, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-M7SSJd/pycurl/setup.py", line 582, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-M7SSJd/pycurl/setup.py", line 99, in __init__
        self.configure()
      File "/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-M7SSJd/pycurl/setup.py", line 316, in configure_unix
        specify the SSL backend manually.''')
    __main__.ConfigurationError: Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using. Please see PycURL documentation for how to specify the SSL backend manually.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-M7SSJd/pycurl/

错误信息是Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using. Please see PycURL documentation for how to specify the SSL backend manually,其实就是让我们在安装之前配置openssl的环境变量

首先要找到openssl的目录,没有安装的去安装(mac 新电脑可以用brew升级到最新的openssl,不然查找是不到的)。

your-name:~$     sudo find / -iname ssl.h
...
/usr/local/Cellar/openssl/1.0.2o_2/include/openssl/ssl.h
...

可以看见我的安装目录是 /usr/local/Cellar/openssl/1.0.2o_2,然后执行下面三个命令

your-name:~$ export PYCURL_SSL_LIBRARY=openssl
your-name:~$ export LDFLAGS=-L安装目录/lib
your-name:~$ export CPPFLAGS=-I安装目录/include

这三个命令官网中可以找到解释。倘若这样仍然报错,那么尝试执行下面这一个命令,进行安装(反正我是这样才安装成功的)

your-name:~$ sudo pip install pycurl  --user

错误二

Collecting pycurl
  Downloading http://mirrors.aliyun.com/pypi/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz (214kB)
    100% |████████████████████████████████| 215kB 5.9MB/s
Installing collected packages: pycurl
  Running setup.py install for pycurl ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-TL3qJK/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/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-record-QM2JGV/install-record.txt --single-version-externally-managed --compile:
    Using curl-config (libcurl 7.54.0)
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.13-intel-2.7
    creating build/lib.macosx-10.13-intel-2.7/curl
    copying python/curl/__init__.py -> build/lib.macosx-10.13-intel-2.7/curl
    running build_ext
    building 'pycurl' extension
    creating build/temp.macosx-10.13-intel-2.7
    creating build/temp.macosx-10.13-intel-2.7/src
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/open -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/docstrings.o
    In file included from src/docstrings.c:4:
    src/pycurl.h:164:13: fatal error: 'openssl/ssl.h' file not found
    #   include <openssl/ssl.h>
                ^~~~~~~~~~~~~~~
    1 error generated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-TL3qJK/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/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-record-QM2JGV/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-TL3qJK/pycurl/

出现这个错误大多是由于错误一的目录没有设置对(或者根本没有设置)引起的,想解决重新读错误一


错误三

Collecting pycurl
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-19vBHu/pycurl/setup.py", line 913, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/tmp/pip-build-19vBHu/pycurl/setup.py", line 582, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/tmp/pip-build-19vBHu/pycurl/setup.py", line 99, in __init__
        self.configure()
      File "/tmp/pip-build-19vBHu/pycurl/setup.py", line 227, in configure_unix
        raise ConfigurationError(msg)
    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-19vBHu/pycurl/

出现了这个问题是找不到curl-config了。
我们应该再安装前让程序可以找到curl-config

官方文档中有说明如何设置(PYCURL_CURL_CONFIG),不懂继续看

所以我应该输入:

you-name:~$     whereis curl-config # 我们先找到curl-config在哪,如果没有的话自己去安装curl
/usr/bin/curl-config
you-name:~$     export PYCURL_CURL_CONFIG=/usr/bin/curl-config # 将其设置进临时环境变量
you-name:~$     pip install pycurl # 开始安装

错误四

your-name:~$     pip install pycurl
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting pycurl
  Downloading http://mirrors.aliyun.com/pypi/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz (214kB)
    100% |████████████████████████████████| 215kB 3.1MB/s
Installing collected packages: pycurl
  Running setup.py install for pycurl ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-aROgmt/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/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-record-tolFvn/install-record.txt --single-version-externally-managed --compile:
    Using /usr/bin/curl-config (libcurl 7.54.0)
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.13-intel-2.7
    creating build/lib.macosx-10.13-intel-2.7/curl
    copying python/curl/__init__.py -> build/lib.macosx-10.13-intel-2.7/curl
    running build_ext
    building 'pycurl' extension
    creating build/temp.macosx-10.13-intel-2.7
    creating build/temp.macosx-10.13-intel-2.7/src
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/docstrings.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/easy.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/easycb.o
    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);
                ~~~~~~~~   ^~~~~~~~~~~~~~~~~~~~
    src/easycb.c:887:19: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                err = ERR_peek_last_error();
                    ~ ^~~~~~~~~~~~~~~~~~~~~
    src/easycb.c:899:11: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
        err = ERR_peek_last_error();
            ~ ^~~~~~~~~~~~~~~~~~~~~
    4 warnings generated.
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/easyinfo.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/easyopt.o
    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));
                        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/easyperform.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/module.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/multi.o
    src/multi.c:843: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);
                       ~ ^~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/oscompat.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/pythoncompat.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/share.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/stringcompat.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/threadsupport.o
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -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 -I/usr/local/Cellar/openssl/1.0.2o_2/include -arch i386 -arch x86_64 -pipe -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_OPENSSL=1 -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.13-intel-2.7/src/util.o
    cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. -L/usr/local/Cellar/openssl/1.0.2o_2/lib -I/usr/local/Cellar/openssl/1.0.2o_2/include build/temp.macosx-10.13-intel-2.7/src/docstrings.o build/temp.macosx-10.13-intel-2.7/src/easy.o build/temp.macosx-10.13-intel-2.7/src/easycb.o build/temp.macosx-10.13-intel-2.7/src/easyinfo.o build/temp.macosx-10.13-intel-2.7/src/easyopt.o build/temp.macosx-10.13-intel-2.7/src/easyperform.o build/temp.macosx-10.13-intel-2.7/src/module.o build/temp.macosx-10.13-intel-2.7/src/multi.o build/temp.macosx-10.13-intel-2.7/src/oscompat.o build/temp.macosx-10.13-intel-2.7/src/pythoncompat.o build/temp.macosx-10.13-intel-2.7/src/share.o build/temp.macosx-10.13-intel-2.7/src/stringcompat.o build/temp.macosx-10.13-intel-2.7/src/threadsupport.o build/temp.macosx-10.13-intel-2.7/src/util.o -lcrypto -lssl -lcurl -o build/lib.macosx-10.13-intel-2.7/pycurl.so
    ld: warning: ignoring file /usr/local/Cellar/openssl/1.0.2o_2/lib/libcrypto.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/openssl/1.0.2o_2/lib/libcrypto.dylib
    ld: warning: ignoring file /usr/local/Cellar/openssl/1.0.2o_2/lib/libssl.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/openssl/1.0.2o_2/lib/libssl.dylib
    running install_lib
    creating /Library/Python/2.7/site-packages/curl
    error: could not create '/Library/Python/2.7/site-packages/curl': Permission denied

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-aROgmt/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/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-record-tolFvn/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/qv/5lbgb8nd7j1_1v_c5hf0h8fm0000gn/T/pip-install-aROgmt/pycurl/

可以看见Permission denied的字眼,切换root用户执行就好了

最后

对你有帮助的资料:
https://www.cnblogs.com/zhzhang/p/8623718.html
https://blog.csdn.net/nellyp/article/details/80110599
https://blog.csdn.net/kriszhang/article/details/74833486

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,222评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,455评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,720评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,568评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,696评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,879评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,028评论 3 409
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,773评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,220评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,550评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,697评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,360评论 4 332
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,002评论 3 315
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,782评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,010评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,433评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,587评论 2 350

推荐阅读更多精彩内容