上善若水,不浮不沉!
分类: LINUX
2018-05-04 14:08:57
最近要对一系列数据做同比比较,需要用到numpy和pandas来计算,不过使用python安装numpy和pandas因为linux环境没有外网遇到了很多问题就记下来了。首要条件,python版本必须是2.7以上(huodie安装的系统为CentOS Linux release 7.4.1708 (Core))。
出自:https://www.cnblogs.com/lxmhhy/p/6029465.html
1.linux首先安装依赖包
yum -y install blas blas-devel lapack-devel lapack
yum -y install seaborn scipy
yum -y install freetype freetype-devel libpng libpng-devel
yum -y install python-pip ,若没有python-pip包,就先执行yum -y install epel-release
yum -y install pytz
yum -y install python-dateutil
2.更新pip,安装numpy、pandas
python -m pip install --upgrade pip #升级pip组件
错误:ReadTimeoutError: HTTPSConnectionPool(host=’pypi.python.org’, port=443): Read
解决办法: 加大超时时间,如pip --default-timeout=100 install -U pip
pip install --user numpy scipy matplotlib jupyter pandas sympy nose --未成功
但很快就会发现这些源安装超级慢,所以我推荐大家使用豆瓣的源
pip install matplotlib -i
错误:ipython 5.6.0 has requirement setuptools>=18.5, but you'll have setuptools 0.9.8 which is incompatible
解决办法:pip install --upgrade setuptools==30.1.0
注:easy_install –version #查看setuptools版本
pip install numpy -i
错误:Please upgrade numpy to >= 1.9.0 to use this pandas version
解决办法:yum remove numpy ,再进行安装
pip install pandas -i
pip install seaborn scipy -i
3.使用命令
https://blog.csdn.net/liuyq859/article/details/78387600
错误:ImportError: No module named Tkinter
解决办法:1> yum list installed | grep ^tk 差找是否安装,2> yum install -y tkinter 和yum install -y tk-devel下载相应模块安装
错误:ImportError: Install xlrd >= 0.9.0 for Excel support
解决办法:pip install xlrd