【发布时间】:2019-05-13 02:55:41
【问题描述】:
我正在尝试使用使用 Matplotlib 绘图的 PyCharm 运行和调试 Python 脚本。但是我也不能这样做,因为 PyCharm 找不到我现有的 Matplotlib 安装,并且当我尝试通过设置/包管理器界面安装 Matplotlib 时无法下载和安装它自己的版本。
但是,我已经在我的计算机上安装了 Matplotlib,当我通过终端运行脚本时,一切正常。
所以我的问题是,我该怎么做:
- 通过 PyCharm 或 成功安装 Matplotlib
- 将 PyCharm 直接安装到我现有的 Matplotlib 安装中
系统版本
- 操作系统: Ubuntu 14.04
- Python: 3.7.0(也安装了 3.4)
- Pip: 18.1 来自 /usr/local/lib/python3.4/dist-packages/pip(python 3.4)
- Pip3: 18.1 来自 /home/matt/anaconda3/lib/python3.7/site-packages/pip(python 3.7)
- Matplotlib: 3.0.2
- PyCharm: PyCharm 社区 v 2018.3.1
- PyCharm 解释器: Python 3.7
通过 PyCharm 安装 Matplotlib 时出错
Collecting matplotlib==3.0.2
Could not fetch URL https://pypi.org/simple/matplotlib/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/matplotlib/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
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
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
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/matplotlib/
Retrying (Retry(total=3, 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/matplotlib/
Retrying (Retry(total=2, 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/matplotlib/
Retrying (Retry(total=1, 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/matplotlib/
Retrying (Retry(total=0, 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/matplotlib/
Could not find a version that satisfies the requirement matplotlib==3.0.2 (from versions: )
No matching distribution found for matplotlib==3.0.2
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
【问题讨论】:
标签: python-3.x ssl matplotlib pip pycharm