简体   繁体   中英

python setup.py config --include-dirs not work when install h5py

the hdf5 library has been installed here: ~/soft/lib/packages/hdf5-1.8.14-linux-centos5-x86_64-gcc412-shared/ . I install h5py using the following command:

python setup.py config --include-dirs=/panfs/home/kang/yangpc/soft/lib/packages/hdf5-1.8.14-linux-centos5-x86_64-gcc412-shared/include/ build

I also try adding one line to the MANIFEST.in file graft /panfs/home/kang/yangpc/soft/lib/packages/hdf5-1.8.14-linux-centos5-x86_64-gcc412-shared/include/ .

Then I try adding the header file path into INCLUDE variable: export INCLUDE=$INCLUDE:/panfs/home/kang/yangpc/soft/lib/packages/hdf5-1.8.14-linux-centos5-x86_64-gcc412-shared/include/ ,

Then try set the CPLUS_INCLUDE_PATH variable: export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/panfs/home/kang/yangpc/soft/include:/panfs/home/kang/yangpc/soft/lib/packages/hdf5-1.8.14-linux-centos5-x86_64-gcc412-shared/include/

It still gives out the errors listed below. It seems that the library header files can not be found. However, I have specified the directory using various methods. Can anyone give some suggestions? thousands thanks!

In file included from /panfs/home/kang/yangpc/soft/Python/python2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804,
                 from /panfs/home/kang/yangpc/soft/Python/python2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from /panfs/home/kang/yangpc/soft/Python/python2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from /panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/api_compat.h:26,
                 from /panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:287:
/panfs/home/kang/yangpc/soft/Python/python2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
In file included from /panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:287:
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/api_compat.h:27:18: error: hdf5.h: No such file or directory
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:290:23: error: H5Cpublic.h: No such file or directory
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:291:21: error: hdf5_hl.h: No such file or directory
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:489: error: expected specifier-qualifier-list before 'H5E_auto_t'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:686: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5open'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:778: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5close'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:870: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5get_libversion'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:962: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5Acreate'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:1054: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5Aopen_idx'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:1146: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5Aopen_name'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:1238: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5Aclose'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:1330: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5Adelete'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:1422: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5Aread'
/panfs/home/kang/yangpc/soft/Python/Python_packages/h5py-2.5.0/h5py/defs.c:1514: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__pyx_f_4h5py_4defs_H5Awrite'

However, when I try installing using pip pip install h5py , It gives the following error:

pip install h5py
/panfs/home/kang/yangpc/soft/Python/python2.7/lib/python2.7/site-packages/pip-7.0.0.dev0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting h5py
/panfs/home/kang/yangpc/soft/Python/python2.7/lib/python2.7/site-packages/pip-7.0.0.dev0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/panfs/home/kang/yangpc/soft/Python/python2.7/lib/python2.7/site-packages/pip-7.0.0.dev0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement h5py (from versions: )
  No matching distribution found for h5py

inspired by this [1] issue, this problem has been resolved by:

export HDF5_DIR=/panfs/home/kang/yangpc/soft/lib/packages/hdf5-1.8.14-linux-centos5-x86_64-gcc412-shared/
python setup.py install --prefix=/anywhere/you/want/

this script should be added to the install README documentation of h5py.

[1] https://github.com/PacificBiosciences/pbcore/issues/5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM