1. 程式人生 > >__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 do

__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 do

  今天在安裝pyspider時遇到這個問題,顯示是安裝pycurl導致的,於是單獨pip install pycurl,報一樣的錯誤,如下:

(general_spider)  ~  pip install pycurl
Collecting pycurl
  Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
    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/rk/mmm98qtx6yjcr1dmtqqclq040000gn/T/pip-install-4G_Fpi/pycurl/setup.py", line 913, in <module> ext = get_extension(sys.argv, split_extension_source=split_extension_source) File
"/private/var/folders/rk/mmm98qtx6yjcr1dmtqqclq040000gn/T/pip-install-4G_Fpi/pycurl/setup.py", line 582, in get_extension ext_config = ExtensionConfiguration(argv) File "/private/var/folders/rk/mmm98qtx6yjcr1dmtqqclq040000gn/T/pip-install-4G_Fpi/pycurl/setup.py", line 99, in __init__ self.configure() File
"/private/var/folders/rk/mmm98qtx6yjcr1dmtqqclq040000gn/T/pip-install-4G_Fpi/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/rk/mmm98qtx6yjcr1dmtqqclq040000gn/T/pip-install-4G_Fpi/pycurl/

  然後問題確定了,網上看看前輩們遇到這樣的問題是怎樣解決的:

Mac os解決方案(親測有效問題已解決):

 export PYCURL_SSL_LIBRARY=openssl
 export LDFLAGS=-L/usr/local/opt/openssl/lib;export CPPFLAGS=-I/usr/local/opt/openssl/include;

centos解決方案(樓主沒有環境,需者自取,驗證完可以告訴樓主一聲~):

export PYCURL_SSL_LIBRARY=openssl

  執行完上述語句之後再執行 pip install curl,成功,皆大歡喜 進行後續操作就可以。

 

希望對你有幫助~

 參考地址:https://stackoverflow.com/questions/51019622/curl-is-configured-to-use-ssl-but-we-have-not-been-able-to-determine-which-ssl