无法将 matplotlib 安装到 pycharm [英] Can't install matplotlib to pycharm

查看:92
本文介绍了无法将 matplotlib 安装到 pycharm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用 Python Crash Course 学习 Python 编程.我被卡住了,因为我无法让 matplotlib 在 pycharm 中工作.

I have recently started to learn python programming using Python Crash Course. I am stuck as I can't get matplotlib to work in pycharm.

我已经安装了 pip.我已经通过命令提示符使用 pip 安装了 matplotlib.

I have pip installed. I have installed matplotlib using pip via command prompt.

现在,当我打开 pycharm 并转到文件->设置-> 项目解释器-> 下载包并找到并按下 matplotlib 的安装时,出现错误:命令python setup.py egg_info"失败,错误代码为 1C:\Users\Tony\AppData\Local\Temp\pip-install-f2h0rvbb\matplotlib\.在 pycharm 上安装时,它说它使用来自网站的缓存文件,我没有从中下载我的 matplotlib.

Now, when I open pycharm and go file->settings->project interpreter->download packages and find and press install for matplotlib, I get an error: Command "python setup.py egg_info" failed with error code 1 in C:\Users\Tony\AppData\Local\Temp\pip-install-f2h0rvbb\matplotlib\ . When installing on pycharm it says its using cached file from website I didn't download my matplotlib from.

我从 pycharm 终端尝试过pip install matplotlib"并得到同样的错误.

I have tried "pip install matplotlib" from pycharm terminal and get the same error.

我尝试从 cmd 中输入pip install matplotlib",它确实这样做了,并说它已经很满意了.

I have tried typing "pip install matplotlib" from cmd and it does so and says its already satisfied.

任何帮助或指导将不胜感激,谢谢.

Any help or guidance would be appreciated, thanks.

推荐答案

通过在 pycharm 终端中输入内容使其正常工作:

Managed to get it to work by typing into pycharm terminal:

pip 安装更新

然后我去文件->设置->项目解释器->然后通过搜索找到pip并再次更新它以更加确定.一旦文件-> 设置-> 项目解释器中列左侧的 pip 版本显示版本是最新的 20.0.2,即 == 右侧(最新版本)列,它已 100% 更新.这也可以通过按下显示早期版本"按钮正上方的升级按钮来完成,当您已经单击该软件包时,该按钮看起来就像右侧栏右侧的一只眼睛.

Then I went to file->settings->project interpreter-> then found pip via search and updated it again to be more sure. Once pip version on left hand side of column in file->settings->project interpreter showed the version to be the newest 20.0.2 which was == to the right hand side(latest version) column it was 100% updated. This can be done also by pressing the upgrade button just above the 'show early releases' button which looks like an eye just to the right of the right hand side column when you have already clicked on the package.

最后我去文件->设置->项目解释器->找到matplotlib并成功安装包.

To finish I went file->settings->project interpreter-> found matplotlib and installed package successfully.

总的来说,我认为没有用于 pycharm 的最新版本的 pip 并且必须更新专门用于 pycharm 的 pip 是无法安装 matplotlib 的原因.虽然这也可能是由于在我的系统上的其他地方单独下载了 pip 试图解决这个问题,当我之前从 cmd.exe 更新 pip 时,它没有更新我用于 Pycharm 的正确版本的 pip.

Overall I think that not having an up to date version of pip being used for pycharm and having to update the one specifically for use in pycharm is responsible not being able to install matplotlib. Although it could have also been due to having downloaded pip separately elsewhere on my system trying to solve this problem and when I have updated pip before from cmd.exe it didn't update the correct version of pip which I am using for Pycharm.

这篇关于无法将 matplotlib 安装到 pycharm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆