1. 程式人生 > >mac升級pip報錯There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]

mac升級pip報錯There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION]

起因:安裝fasttext(sudo pip install fasttext)

報錯:There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] 

解釋:證書有問題 

解決:sudo curl https://bootstrap.pypa.io/get-pip.py | python

問題來了--- 更新不了 [SSL: TLSV1_ALERT_PROTOCOL_VERSION] 這個錯誤依然存在,因為更新不了,還會告訴你,現在是9.0.1版本 需要更新到18.0版本,而且會告訴你

          Could not install packages due to an EnvironmentError: [Errno 13] Permission denied

          Consider using the `--user` option or check the permissions.

如何解決:

首先執行 sudo curl https://bootstrap.pypa.io/get-pip.py >> get-pip.py

然後執行 sudo python get-pip.py

總結:會出現各種許可權的問題 sudo可以直接獲得root許可權,無意間嘗試發現這樣可以,呵呵了~~