【转载】python安装numpy和pandas
转载:原文地址 http://www.cnblogs.com/lxmhhy/p/6029465.html
最近要对一系列数据做同比比较,需要用到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
windows安装pip即可,具体方法参考pip官网 http://pip-cn.readthedocs.io/en/latest/installing.html
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 install seaborn scipy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
2、如果服务器上没有外网使用不了pip,则需要使用源码安装。推荐大家在豆瓣pypi下载,速度更快 https://pypi.doubanio.com/simple/?allow_list_dir=1
python numpy安装包下载地址是 https://pypi.python.org/pypi/numpy/,pandas的安装包下载地址是https://pypi.python.org/pypi/pandas,github地址是 https://github.com/pandas-dev
tar -xzf numpy-1.11.2.tar.gz
cd numpy-1.11.2
python setup.py build # 编译几分钟
python setup.py install
如提示缺少 setuptools 则从https://pypi.python.org/pypi/setuptools下载 setuptools安装。
安装pandas会提示 ImportError: Building pandas requires cython则需要安装Cython或者升级Cython先,下载链接 https://pypi.python.org/pypi/Cython/。windows下pip安装如下
pip install Cython
linux下可使用yum安装或者pip安装
yum install -y Cython.x86_64
如果需要更新到最新版本的Cython则下载源码后安装
cd Cython-0.25.1
python setup.py build
python setup.py install
然后是按照pandas
cd pandas-0.19.0
python setup.py build # 比较久
python setup.py install
如果遇到需要安装 python-dateutil的提示则是该库版本过低。先下载six最新版本1.9.0(下载地址),然后更新 python-dateutil到新版本2.5.3版本(下载地址)。
最后运行如果出现 /usr/lib64/libstdc++.so.6: ELF file OS ABI invalid的错误则将 /usr/lib64/libstdc++.so.6软链指向低版本的 libstdc++.so.6.0.8,不要指向高版本 libstdc++.so.6.0.20。
至此就安装成功了。
总结,花了一上午安装这个主要是因为下载源慢,依赖包多。所以建议大家都是用pypi豆瓣源,直接在simple下面搜你需要的安装包。
【转载】python安装numpy和pandas的更多相关文章
- python安装numpy和pandas
最近要对一系列数据做同比比较,需要用到numpy和pandas来计算,不过使用python安装numpy和pandas因为linux环境没有外网遇到了很多问题就记下来了.首要条件,python版本必须 ...
- [转] python安装numpy和pandas
最近要对一系列数据做同比比较,需要用到numpy和pandas来计算,不过使用python安装numpy和pandas因为linux环境没有外网遇到了很多问题就记下来了.首要条件,python版本必须 ...
- ubuntu python 安装numpy,scipy.pandas.....
http://blog.csdn.net/Yakumoyukarilan/article/details/51340358
- Python入门之安装numpy和pandas
最近要对一系列数据做同比比较,需要用到numpy和pandas来计算,不过使用python安装numpy和pandas因为linux环境没有外网遇到了很多问题就记下来了. 首要条件,python版本必 ...
- Python离线断网情况下安装numpy、pandas和matplotlib等常用第三方包
联网情况下在命令终端CMD中输入“pip install numpy”即可自动安装,pandas和matplotlib同理一样方法进行自动安装. 工作的电脑不能上外网,所以不能通过直接输入pip命令来 ...
- windows下python安装Numpy、Scipy、matplotlib模块(转载)
python下载链接 Numpy下载链接 python中Numpy包的安装及使用 Numpy包的安装 准备工作 Python安装 pip安装 将pip所在的文件夹添加到环境变量path路径中 ...
- python2.7安装numpy、pandas、matplotlib库
我装的是python2.7 然后pip的版本是18.1,最近使用pip install **安装包的时候总是会提示 You are using pip version 18.1, however ve ...
- [python] 安装numpy+scipy+matlotlib+scikit-learn及问题解决
这篇文章主要讲述Python如何安装Numpy.Scipy.Matlotlib.Scikit-learn等库的过程及遇到的问题解决方法.最近安装这个真是一把泪啊,各种不兼容问题和报错,希望文章对你有所 ...
- linux离线搭建Python环境及安装numpy、pandas
1.安装python2.7.3 Cent OS 6.5默认装的有python2.6.6,需要重新安装python2.7.3下载地址:https://www.python.org/downloads/s ...
随机推荐
- maven nexus私服搭建
1. 下载 wget http://download.sonatype.com/nexus/oss/nexus-2.12.0-01-bundle.tar.gz 2. 解压 tar zxvf nexus ...
- Linux基础入门第三节(修改)
第三节 作业部分 添加一个用户loutest,使用sudo创建文件/opt/forloutest,设置成用户loutest可以读写.截图并把操作过程写入实验报告. 找到了解决的办法,在touch命令前 ...
- POJ2533_Longest Ordered Subsequence (线性动态规划变形)
本题求一个字符串中的最长递增子序列的长度. 动态规划方程 a[]记录字符串: d[i]记录以第i个元素为最后一个元素的最长递增序列的长度 则 d[i+1]=1+max(d[j]) 其中(j<i ...
- 基于Oracle Sequence的流水号生成规则
流水号在各种系统中随处可见,一般都是使用自增.年月日时分秒+自增.UUID等,要么纯数字,要么纯字母,这种流水号缺乏一定的辨识度. 下面为大家介绍一种具有辨识度的流水号的生成方式:领域或者应用的标识 ...
- try catch finally return
public override bool Start(IServerConfig config) { bool flag = true; listenSocket = new Socket(Liste ...
- github上fork别人的代码之后,如何保持和原作者同步的更新
1.从自己fork之后的版本库clone $ git clone -o chucklu https://github.com/chucklu/Hearthstone-Deck-Tracker.git ...
- Validate Binary Search Tree,判断是否是二叉排序树
算法分析:两种方法,一种是中序遍历,然后得到一个序列,看序列是否是有序的.第二种,是用递归. 中序遍历: public class Solution { List<Integer> lis ...
- Github Clone to local files
cd to you local files address key the word: git clone -0 github https://github.com/xxxxxxxxx Done... ...
- install ros-indigo-map-msgs
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake: (find_package): Could not fi ...
- bootstrap.min.css.map HTTP/1.1" 404 1699
在做一个jsp练习的时候遇到引入bootstrap.css的时候出现了URL:bootstrap.min.css.map 404的错误. 解决办法:删除bootstrap.min.css文件内容最后一 ...