对于python,请安装hdf5/netcdf4 [英] For python, install hdf5/netcdf4

查看:317
本文介绍了对于python,请安装hdf5/netcdf4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux Mint 17.1上执行此操作.

当我尝试时:

pip install hdf5

我收到错误

"Could not find a version that satisfies the requirement hdf5 (from versions: ) No matching distribution found for hdf5"

从长远来看,我正在尝试安装netcdf4,但是直到安装hdf5后才能这样做.大概从上周我尝试使用netcdf4做起,我应该使用pip install netcdf4,err hdf5 ...至少在hdf5的情况下.

如果我尝试pip install h5py,我得到的消息是:

Requirement already satisfied (use --upgrade to upgrade): h5py in ./anaconda3/lib/python3.5/site-packages Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.1 in ./anaconda3/lib/python3.5/site-packages (from h5py) Requirement already satisfied (use --upgrade to upgrade): six in ./anaconda3/lib/python3.5/site-packages (from h5py)

但是,如果我继续尝试pip install netcdf4,它会显示并显示:

Collecting netcdf4 Using cached netCDF4-1.2.3.1.tar.gz Complete output from command python setup.py egg_info: Package hdf5 was not found in the pkg-config search path. Perhaps you should add the directory containing hdf5.pc' 到PKG_CONFIG_PATH环境变量 找不到软件包"hdf5" cython版本0.23.4已找到... 从setup.cfg中读取...

HDF5_DIR environment variable not set, checking some standard locations ..
checking /home/meant2b ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
checking /usr ...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-pq3yt4ek/netcdf4/setup.py", line 286, in <module>
    raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers

----------------------------------------

/tmp/pip-build-pq3yt4ek/netcdf4/`中的命令"python setup.py egg_info"失败,错误代码为1.

当我搜索文件时,找不到hdf5.pc文件.

h5py和hdf5之间有区别吗?我必须从单个文件编译并安装hdf5还是可以点安装.

要同时安装hdf5和netcdf4,我该怎么办?

解决方案

您需要为Linux发行版安装HDF5库.在Ubuntu中是:

sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev

请参见此链接.

Doing this on a Linux Mint 17.1.

When I try:

pip install hdf5

I get the error

"Could not find a version that satisfies the requirement hdf5 (from versions: ) No matching distribution found for hdf5"

I'm trying in the long run to install netcdf4 but can't do that until I get hdf5 installed. Supposedly from when I was trying to do this last week, with netcdf4, I should be using the pip install netcdf4, err hdf5...at least maybe in the case of hdf5.

If I try pip install h5py I get that the message saying:

Requirement already satisfied (use --upgrade to upgrade): h5py in ./anaconda3/lib/python3.5/site-packages Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.1 in ./anaconda3/lib/python3.5/site-packages (from h5py) Requirement already satisfied (use --upgrade to upgrade): six in ./anaconda3/lib/python3.5/site-packages (from h5py)

Yet if I go ahead and try pip install netcdf4 it comes up and says:

Collecting netcdf4 Using cached netCDF4-1.2.3.1.tar.gz Complete output from command python setup.py egg_info: Package hdf5 was not found in the pkg-config search path. Perhaps you should add the directory containinghdf5.pc' to the PKG_CONFIG_PATH environment variable No package 'hdf5' found cython version 0.23.4 found ... reading from setup.cfg...

HDF5_DIR environment variable not set, checking some standard locations ..
checking /home/meant2b ...
checking /usr/local ...
checking /sw ...
checking /opt ...
checking /opt/local ...
checking /usr ...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-pq3yt4ek/netcdf4/setup.py", line 286, in <module>
    raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-pq3yt4ek/netcdf4/`

When I search the files I don't find a hdf5.pc file.

Is there a difference between h5py and hdf5? Do I have to compile and install hdf5 from the individual files or can I pip install.

What do I have to do to be able to install both hdf5 and netcdf4?

解决方案

You need to install the HDF5 libraries for your Linux distribution. In Ubuntu is:

sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev

See this link.

这篇关于对于python,请安装hdf5/netcdf4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆