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