简体   繁体   English

无法为Python 3安装matplotlib

[英]Unable to install matplotlib for Python 3

I'm using JetBrains PyCharm Community Edition 2016.3.2 (64). 我正在使用JetBrains PyCharm Community Edition 2016.3.2(64)。 My Project Interpreter is either Python 3.4 or 3.5. 我的项目解释器是Python 3.4或3.5。 I'm trying to install the Matplotlib package but failed every time. 我正在尝试安装Matplotlib软件包,但每次都失败。 I succeeded on installing Networkx though. 我虽然成功安装了Networkx。

On this site https://networkx.github.io/documentation/networkx-1.10/tutorial/tutorial.html , in the "Drawing graphs" section, it says 在此站点https://networkx.github.io/documentation/networkx-1.10/tutorial/tutorial.html的“绘图图”部分中,它说

Note that the drawing package in NetworkX is not yet compatible with Python versions 3.0 and above. 请注意,NetworkX中的绘图包尚未与Python 3.0及更高版本兼容。

Someone please confirm this? 有人请确认吗? Should I install Python 2.x to use this package? 我是否应该安装Python 2.x才能使用此软件包?
I'm doing graph modelling, if anyone can suggest other packages or advise whatever I should use, I would really appreciate. 我正在进行图形建模,如果有人可以建议其他软件包或提供我应该使用的任何建议,我将非常感激。 But it needs to be related to Networkx. 但是它需要与Networkx相关。

Regarding Matplotlib, I don't see why the installation would fail. 关于Matplotlib,我不明白为什么安装会失败。

try: 尝试:

sudo apt-get install python3-matplotlib

Depending on your installation, you'll also have to install several libraries that matplotlib depends on: 根据您的安装,您还必须安装matplotlib依赖的几个库:

sudo apt-get install python3.5-dev python3.5-tk tk-dev
sudo apt-get install libfreetype6-dev g++
sudo apt install python3-pip
pip3 install --user matplotlib

In addition, you will need one other package - nose. 另外,您将需要另一个包裹-鼻子。 You can install it using the same syntax: 您可以使用相同的语法进行安装:

sudo pip3 install nose

Networkx installation is simple as: Networkx安装很简单,如下所示:

sudo pip3 install networkx

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM