3

I have to install python package "matplotlib" in Python 2.7; Ubuntu 16.04 After inserting:

pip install matplotlib

I get the following error messagge: open here error picture I tried this solution:

sudo apt-get install libfreetype6-dev libxft-dev

but I got this error:

"Lettura elenco dei pacchetti... Fatto Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto E: Impossibile trovare il pacchetto libfreetype6-dev E: Impossibile trovare il pacchetto libxft-dev"

Alice
  • 131

2 Answers2

2
  1. Check in Software & Updates -> Ubuntu Software tab that the 2nd software source universe is enabled.

  2. The currently supported releases of Ubuntu are 14.04, 16.04 and 17.10. If you are not running a currently supported release, see the answers to this question: How to install software or upgrade from an old unsupported release?.

Matplotlib is available in the default Ubuntu repositories in all currently supported versions of Ubuntu. To install Matplotlib open the terminal and type:

sudo apt update  
sudo apt upgrade  
sudo apt install python-matplotlib # for Python 2.x in 18.04 and earlier

or

sudo apt update  
sudo apt upgrade  
sudo apt install python3-matplotlib # for Python 3.x 

Other related packages are python-matplotlib-data python-matplotlib-dbg python-matplotlib-doc and python-matplotlib-venn for Python 2.x and python3-matplotlib-dbg python3-matplotlib-venn for Python 3.x.

karel
  • 122,292
  • 133
  • 301
  • 332
0

Install python dev file by typing:

sudo apt install python-dev

Then proceed