1.系统环境
centos-6.4 Python2.6
2.安装步骤
1.检查Python版本
2.安装setuptools
原因:
安装pip时没有setuptools会显示无法安装步骤:
下载安装包
http://zhongwei-leg.iteye.com/blog/813753 sh setuptools-0.6c11-py2.6.egg
3.安装pip
3.1下载
wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certifica
3.2 pip安装
tar -xzvf pip-1.5.4.tar.gzcd pip-1.5.4python setup.py install
3.3修改pip镜像为国内镜像
cd /root/.pip/vim pip.conf[global]index-url=http://pypi.v2ex.com/simple
注意为了防止以后安装出问题建议检测一下编译环境
yum install gcc* make*
4.安装numpy
报错如下:
解决:yum install python-devel
pip install numpy再次 pip install numpy
5.安装hdf5
5.1下载
https://github.com/live-clones/hdf5
5.2安装
https://github.com/live-clones/hdf5/blob/master/release_docs/INSTALL
Quick installationFor those who don't like to read ;-) the following steps can be usedto configure, build, test, and install the HDF5 Library, header files,and support programs. For example, to install HDF5 version X.Y.Z atlocation /usr/localf5, use the following steps.
$ gunzip < hdf5-X.Y.Z.tar.gz | tar xf -$ cd hdf5-X.Y.Z$ ./configure --prefix=/usr/localf5 <more configure_flags>$ make$ make check # run test suite.$ make install$ make check-install # verify installation.Some versions of the tar command support the -z option. In such cases,the first step above can be simplified to the following:$ tar zxf hdf5-X.Y.Z.tar.gz6.安装pytsbles
pip install tables
这个报错是因为没有安装numexpr造成的
解决: pip install numexpr同理:pip install Cython
解决:vi /root/.bash_prefileexport HDF5_DIR=/usr/localf5 该目录是安装hdf5时./configure --prefix所指定到目录source /root/.bash_profilepip install tables //安装成功可能会出错>>> import tablesTraceback (most recent call last): File "", line 1, in File "/usr/lib64/python2.6/site-packages/tables/__init__.py", line 82, in from tables.utilsextension import (ImportError: libhdf5.so.6: cannot open shared object file: No such file or directory解决方案vi /root/.bash_prefileexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/hdf5/lib/
7.安装pandas
pip install pandas
安装成功!
HDF文件详解