python-3.x - PyCharm 找不到现有的 Matplotlib 安装或安装新的
问题描述
我正在尝试使用使用 Matplotlib 图的 PyCharm 运行和调试 Python 脚本。但是我也不能这样做,因为 PyCharm 找不到我现有的 Matplotlib 安装,并且当我尝试通过设置/包管理器界面安装 Matplotlib 时无法下载和安装它自己的版本。
但是,我已经在我的计算机上安装了 Matplotlib,当我通过终端运行脚本时,一切正常。
所以我的问题是,我怎么能:
- 通过 PyCharm 成功安装 Matplotlib 或
- 将 PyCharm 指向我现有的 Matplotlib 安装
系统版本
- 操作系统: Ubuntu 14.04
- Python: 3.7.0(也安装了3.4)
- 点子:来自 /usr/local/lib/python3.4/dist-packages/pip 的 18.1(python 3.4)
- Pip3:来自 /home/matt/anaconda3/lib/python3.7/site-packages/pip 的 18.1(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 不包括 OpenSSL 1.0.2 或更高版本,Python 3.7 现在需要它。这意味着不会内置 python 的 ssl 模块。没有 ssl 模块 pip 无法从存储库下载包。
如果您将pycharms配置为使用终端将使用的系统版本的 python (3.4),那么您应该可以得到 matplotlib。
我的建议是升级到 16.04 或更高版本。
推荐阅读
- linux - 未在引导时为计算模块 3 eMMC 设置 udev 标记 systemd
- function - 按类别在产品价格上加一定金额
- android - DevOpS 无法构建 Xamarin 应用程序
- flutter - 使用颤振应用程序在 Android 上启动 Google 表格应用程序
- c - 使用mimick模拟退出时堆栈不是16字节对齐错误
- django - 表单中的 Django 选择字段
- android - 将 AGP 从 4.1.3 更新到 4.2.2 后 - 出现错误“任务 ':app:lintVitalProductionRelease' 执行失败”
- amazon-web-services - 如何在 AWS Lambda 中将 ConversationHandler 用于 Telegram 机器人
- azure - 有没有办法在 PowerShell 替换脚本中替换 YAML 变量?
- reactjs - 站点 PWA utilizando 反应