您好,登錄后才能下訂單哦!
這篇文章主要介紹“ubuntu pip is configured with locations that require TLS/SSL錯誤怎么解決”,在日常操作中,相信很多人在ubuntu pip is configured with locations that require TLS/SSL錯誤怎么解決問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”ubuntu pip is configured with locations that require TLS/SSL錯誤怎么解決”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
背景:
ubuntu 14.04
python3.8
使用pip install pymsql 提示錯誤:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting django WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/django/ Could not fetch URL https://pypi.org/simple/django/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/django/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping ERROR: Could not find a version that satisfies the requirement django (from versions: none) ERROR: No matching distribution found for django WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
原因:
因為pip安裝第三方庫需要ssl模塊,而python默認安裝ssl功能是不可用的
解決辦法是重新編譯python3安裝文件,加上--with-ssl參數就可以讓pip3使用ssl功能了
#重新編譯安裝 ./configure --enable-optimizations --with-ssl
Ubuntu 16.04 安裝(install)python3.8
永久修改pip源
如果需要永久修改pip的軟件鏡像源,可以通過修改配置文件實現。
在Linux下,修改~/.pip/pip.conf,如果沒有則創建:
mkdir ~/.pip vim ~/.pip/pip.conf
添加以下內容
[global] index-url = http://mirrors.aliyun.com/pypi/simple/ [install] trusted-host = mirrors.aliyun.com
或者是:
[global] timeout = 6000 index-url = http://pypi.douban.com/simple/ [install] use-mirrors = true mirrors = http://pypi.douban.com/simple/ trusted-host = pypi.douban.com
到此,關于“ubuntu pip is configured with locations that require TLS/SSL錯誤怎么解決”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。