今天使用pip3安裝jupyter時,總是會報錯:
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
解決辦法:使用鏡像,如下:
pip3 install -i https://pypi.douban.com/simple jupyter
或者使用其他源:
(1)pip install -i https://pypi.tuna.tsinghua.edu.cn/simple module_name (2)pip install -i https://pypi.douban.com/simple module_name
一般情況下pip出現ReadTimeoutError都是因為被GFW給牆了,所以一般遇到這種問題,我們可以選擇國內的鏡像解決問題。
在Windows下: C:\Users\Administrator\下新建pip文件夾,在創建pip.ini文件,拷貝下面代碼進去,保存。 [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple 其實就是把python的源換成了清華源,應該能解決問題。 延長等待時間完美解決問題 windows下在cmd中,linux在終端下輸入如下命令: pip --default-timeout=100 install -U pip
參考:https://www.jb51.net/article/171335.htm
針對各種問題,網友總是有很多硬核的解決辦法,實在佩服佩服,這里做下記錄,方便復習。
