Python中安装框架如何换源

想安装tornado框架,但总是有奇怪错误,如下:

Python中安装框架如何换源

如果按照默认的下载源,就会死活不成功,出现

Traceback (most recent call last):
File "e:\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 397, in _error_catcher
yield
File "e:\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 479, in read
data = self._fp.read(amt)
File "e:\python38\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "e:\python38\lib\http\client.py", line 454, in read
n = self.readinto(b)
File "e:\python38\lib\http\client.py", line 498, in readinto
n = self.fp.readinto(b)
File "e:\python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "e:\python38\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)

.......

这样的的错误。

解决办法是,换源下载

pip install tornado -i https://pypi.douban.com/simple

Python中安装框架如何换源

相关推荐