您的位置:首页 > 编程语言 > PHP开发

debian上安装matplotlib sklearn

2016-08-09 17:29 495 查看

安装机器学习环境

配置pip源

[global]
index-url = http://pypi.v2ex.com/simple [install]
trusted-host = pypi.v2ex.com


或者

[global]
index-url = http://mirrors.aliyun.com/pypi/simple trusted-host = mirrors.aliyun.com


参考

http://www.tuicool.com/articles/MRNV7r

安装过程

apt-get install build-essential python-dev libfreetype6-dev libpng-dev python-virtualenv


apt-get install libatlas-dev libatlas3gf-base


pip install numpy


pip install matplotlib


[出现错误]

freetype: no [The C/C++ header for freetype2 (ft2build.h)

could not be found. You may need to install the

development package.]

[解决方案]

把这个文件拷出来,能让gcc找到就可以了

$ cp /usr/include/freetype2/ft2build.h /usr/include/ft2build.h


pip install matplotlib


最后安装sklearn

官方推荐用Canopy and Anaconda 来安装,可是我下载得比较慢。鼓励大家也还是用这个来安装试试。

Installing scikit-learn¶

参考

Installing scipy on redhat with error “no lapack/blas resources found”

apt-get install libblas-dev liblapack-dev
apt-get install gfortran


pip install scipy


pip install sklearn


至此安装完成。

另外的一些参考

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.bz2 tar -xjvf freetype-2.6.1.tar.bz2
cd freetype-2.6.1/
./configure --prefix=/usr/local
make
sudo make install


http://blog.sina.com.cn/u/1560993520

即使已经安装了freetype2

$ pacman -S freetype2

$ pacman -Ql freetype2 | grep ft2build.h

freetype2 /usr/include/freetype2/ft2build.h

结果只要把这个文件拷出来,能让gcc找到就可以了

$ cp /usr/include/freetype2/ft2build.h /usr/include/ft2build.h
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python