简体   繁体   中英

Unable to install matplotlib for Python 3

I'm using JetBrains PyCharm Community Edition 2016.3.2 (64). My Project Interpreter is either Python 3.4 or 3.5. I'm trying to install the Matplotlib package but failed every time. I succeeded on installing Networkx though.

On this site https://networkx.github.io/documentation/networkx-1.10/tutorial/tutorial.html , in the "Drawing graphs" section, it says

Note that the drawing package in NetworkX is not yet compatible with Python versions 3.0 and above.

Someone please confirm this? Should I install Python 2.x to use this package?
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.

Regarding Matplotlib, I don't see why the installation would fail.

try:

sudo apt-get install python3-matplotlib

Depending on your installation, you'll also have to install several libraries that matplotlib depends on:

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:

sudo pip3 install networkx

Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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