gpt4 book ai didi

python-3.x - PyCharm 找不到现有的 Matplotlib 安装或安装新的

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:45 25 4
gpt4 key购买 nike

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

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

所以我的问题是,我怎样才能:

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

最佳答案

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

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

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

关于python-3.x - PyCharm 找不到现有的 Matplotlib 安装或安装新的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53735634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com