HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out的解決方法

問題描述:python

Pycharm建立Django項目提示:HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed outlinux

 

 

 

 

解決方法:windows

這個問題是由於訪問files.pythonhosted.org超時引發的,換爲國內的豆瓣源就能夠解決url

一、建立配置文件,windows命名pip.ini,linux、mac命名pip.confspa

[global]
timeout = 60
index-url = https://pypi.doubanio.com/simple

二、配置文件放置到指定位置code

windows爲:%APPDATA%\pip\pip.ini 或 %HOME%\pip\pip.ini
blog

linux爲:$HOME/.config/pip/pip.conf 或 $HOME/.pip/pip.confip

mac爲  :$HOME/Library/Application Support/pip/pip.conf 或 $HOME/.pip/pip.confit

其中$HOME指的是用戶主目pip

三、若是經過命令安裝,也能夠每次都指定源

命令如: pip install SQLAlchemy -i https://pypi.doubanio.com/simple

相關文章
相關標籤/搜索