无法获取 URL(python3.6 pip 问题)

Posted

技术标签:

【中文标题】无法获取 URL(python3.6 pip 问题)【英文标题】:Could not fetch URL (python3.6 pip problem) 【发布时间】:2019-09-14 04:57:40 【问题描述】:

我正在尝试在 python 3.6 上安装 discord.py

我试过了

python3.6 -m pip install discord.py

但它给了我:

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: discord.py in /usr/local/lib/python3.6/site-packages/discord.py-1.0.1-py3.6.egg (1.0.1)
Requirement already satisfied: aiohttp<3.6.0,>=3.3.0 in /usr/local/lib/python3.6/site-packages/aiohttp-3.5.4-py3.6-linux-armv7l.egg (from discord.py) (3.5.4)
Collecting websockets<7.0,>=6.0 (from discord.py)

  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/websockets/

  #more retries

Could not fetch URL https://pypi.org/simple/websockets/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/websockets/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping

  Could not fetch URL https://www.piwheels.org/simple/websockets/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/websockets/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
  Could not find a version that satisfies the requirement websockets<7.0,>=6.0 (from discord.py) (from versions: )
No matching distribution found for websockets<7.0,>=6.0 (from discord.py)

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
Could not fetch URL https://www.piwheels.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping


最引起我注意的是:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

但我不知道这是什么意思

【问题讨论】:

你安装了openssl吗? 【参考方案1】:

以下链接中的最后一个答案可能有用:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

另外,如果安装了anaconda,尝试通过Anaconda提示符运行pip安装。

【讨论】:

以上是关于无法获取 URL(python3.6 pip 问题)的主要内容,如果未能解决你的问题,请参考以下文章

当我输入“python3.6 get-pip.py”时,无法修复“zipimport.ZipImportError:无法解压缩数据;zlib 不可用”

python3.6的pip升级不到22.31

常见问题:Linux安装Python3步骤Windows无法利用pip

Cygwin上的Python3.6无法安装模块

Python 3.6 Beautiful Soup - 在网页抓取期间无法获取嵌入式视频 URL

pip 连接失败:无法获取索引基本 URL http://pypi.python.org/simple/