最近要对一系列数据做同比比较,需要用到numpy和pandas来计算,不过使用Python安装numpy和pandas因为linux环境没有外网遇到了很多问题就记下来了。首要条件,python版本必须是2.7以上。
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
yum -y install pytz
yum -y install python-dateutil
1、 pip方式安装
如果有外网一般推荐使用pip安装,linux下和windows下均可使用pip安装
python -m pip install --upgrade pip
pip install --user numpy scipy matplotlib jupyter pandas sympy nose
但很快就会发现这些源安装超级慢,所以我推荐大家使用豆瓣的源
pip install matplotlib -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip install numpy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip instal