【Python】pip install 远程主机强迫关闭了一个现有的连接 问题解决

在新的电脑上配置Python环境,pip安装第三方库时遇到了一些问题,记录一下。

pip install scrapy

报错: 

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) 
after connection broken by 'ProtocolError('Connection aborted.', 
ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)

查找了一下资料,说是网络的问题,切换到其他的镜像来加速。

pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

还是报错:

ERROR: Could not find a version that satisfies the requirement scrapy (from versions: none)
ERROR: No matching distribution found for scrapy

到这一步还是不行。后面我尝试在pycharm里安装第三方库,成功了。

file-->settings-->Project:xxxx--->Project Interpreter--> 右边有个加号 + 添加你要的第三方库

 

你可能感兴趣的:(Python)