matplotlib InstallationError: Command python setup.py egg_info failed with error code 1


Ubuntu下安裝numpy and matplotlib:

安裝numpy相對簡單,以下命令可以完成:

apt-get install python-numpy apt-get install python-scipy

安裝matplotlib相對復雜一些
需要先安裝其依賴的包libpng和freetype
安裝libpng:

sudo apt-get install libpng-dev

安裝freetype:

1. cd ~/Downloads
2. wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz
3. tar zxvf freetype-2.4.10.tar.gz
4. cd freetype-2.4.10/
5. ./congfigure
6. make
7. sudo make install

安裝pip,然后通過pip來安裝matplotlib: 

sudo apt-get install python-pip

安裝好pip后就可以用下面的命令來查找matplotlib和查看其安裝狀態:

sudo pip search matplotlib

安裝matplotlib:

sudo pip install matplotlib

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM