解析HDF文件

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.gz
cd pip-1.5.4
python 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

报错如下:

103040_DEhD_1464648.png

解决:yum install python-devel

pip install numpy
再次 pip install numpy

103113_DBOo_1464648.png

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.gz

6.安装pytsbles

pip install tables

103145_TnNH_1464648.png

这个报错是因为没有安装numexpr造成的
解决: pip  install numexpr

103303_4GPC_1464648.png

同理:pip install Cython

103332_Kthn_1464648.png
解决:vi /root/.bash_prefile

export HDF5_DIR=/usr/localf5   该目录是安装hdf5时./configure --prefix所指定到目录
source /root/.bash_profile
pip install tables  //安装成功

可能会出错
>>> import tables
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/tables/__init__.py", line 82, in <module>
    from tables.utilsextension import (
ImportError: libhdf5.so.6: cannot open shared object file: No such file or directory

解决方案
vi /root/.bash_prefile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/hdf5/lib/

7.安装pandas

pip install pandas

103404_3omd_1464648.png 

安装成功!

HDF文件详解

http://my.oschina.net/crxy/blog/348868


转载于:https://my.oschina.net/zhangxc73912/blog/397209

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值