【问题标题】:PyCharm cannot find existing Matplotlib installation or install new onePyCharm 找不到现有的 Matplotlib 安装或安装新的
【发布时间】:2019-05-13 02:55:41
【问题描述】:

我正在尝试使用使用 Matplotlib 绘图的 PyCharm 运行和调试 Python 脚本。但是我也不能这样做,因为 PyCharm 找不到我现有的 Matplotlib 安装,并且当我尝试通过设置/包管理器界面安装 Matplotlib 时无法下载和安装它自己的版本。

但是,我已经在我的计算机上安装了 Matplotlib,当我通过终端运行脚本时,一切正常。

所以我的问题是,我该怎么做:

  1. 通过 PyCharm 或
  2. 成功安装 Matplotlib
  3. 将 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


    【解决方案1】:

    Ubuntu 14.04 不包括 OpenSSL 1.0.2 或更高版本,Python 3.7 现在需要它。这意味着不会内置python的ssl模块。没有ssl模块,pip无法从存储库下载包。

    如果您configure pycharms 使用您的系统版本的 python (3.4),这是终端将使用的,您应该可以获取 matplotlib。

    我的建议是升级到 16.04 或更高版本。

    【讨论】:

    • 那行得通。当然,因为是 Python3.4,所以 PyCharm 可以安装的 matplotlib 最新版本是 2.2.3,但总比没有好。
    猜你喜欢
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-13
    • 1970-01-01
    • 2018-08-15
    • 2019-01-08
    • 2017-01-29
    相关资源
    最近更新 更多