快乐学python

一步解决mac osx下pycurl安装问题

2019-03-15  本文已影响0人  DS事务所

最近几天在macbook上安装pycurl遇到的问题,谷歌了各种解决方案,有说虚拟环境设置的、修改系统OpenSSL设置的,发现都没什么用。一直都是下面这个报错:

File "/tmp/pip-install-mKzGEO/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.
    
    ----------------------------------------
__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.

解决方法——VirtualEnv下执行下面这段命令(其实是哪执行的安装哪,要全局安装就不用进Python虚拟环境):

export PYCURL_SSL_LIBRARY=openssl
export LDFLAGS=-L/usr/local/opt/openssl/lib;export CPPFLAGS=-I/usr/local/opt/openssl/include;pip install pycurl --compile --no-cache-dir

问题总结:

--compile --no-cache-dir // 这里是问题关键
上一篇 下一篇

猜你喜欢

热点阅读