安裝第三方庫的時候報錯 pip._vendor.urllib3.exceptions.ReadTimeoutError

在安裝第三方庫的時候,Python報錯pip._vendor.urllib3.exceptions.ReadTimeoutError:HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

 

pip --default-timeout=100 install gevent

可通過如下兩種方法解決:
方法一:添加豆瓣源   pip --default-timeout=100 install 庫名稱 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

方法二:添加清華源   pip --default -timeout =100 install 庫名稱 -i https://pypi.tuna.tsinghua.edu.cn/simple  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章