在使用pip时,经常出现下载速度非常非常非常慢,然后报错,我在安装sklearn时就遇见以下报错:
----------- ---------------------------- 4.2/14.7 MB 28.9 kB/s eta 0:06:05
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\bizhi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
yield
File "c:\users\bizhi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "c:\users\bizhi\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 90, in read
data = self.__fp.read(amt)
File "c:\users\bizhi\appdata\local\programs\python\python39\lib\http\client.py", line 455, in read
n = self.readinto(b)
File "c:\users\bizhi\appdata\local\programs\python\python39\lib\http\client.py", line 499, in readinto
n = self.fp.readinto(b)
File "c:\users\bizhi\appdata\local\programs\python\python39\lib\socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "c:\users\bizhi\appdata\lo
然后重点来了!修改pip源!
方法:
%appdata%
,会自动进入AppData/Roaming文件夹。[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple
再次使用pip,就可以高速下载了。
接着我们开始下载sklearn