pip 安装python报错:由于目标计算机积极拒绝,无法连接问题的解决方法

1.问题描述:今天用jupyter notebook 安装wordcloud,尝试了3中方法总是报同一个错误。

2.错误展示:

Collecting wordcloud
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')': /simple/wordcloud/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')': /simple/wordcloud/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')': /simple/wordcloud/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')': /simple/wordcloud/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')': /simple/wordcloud/
  ERROR: Could not find a version that satisfies the requirement wordcloud (from versions: none)
ERROR: No matching distribution found for wordcloud

3.问题解决:将原本的执行命令:!pip install wordcloud  改为:

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

再执行命令就会成功。

你可能感兴趣的:(博文)