error installing h5py, (ImportError: No module named Cython.Build)

2,161 views
Skip to first unread message

Sam Amini

unread,
Jul 29, 2015, 9:34:25 AM7/29/15
to h5py
Dear,

I am trying to install h5py on my home directory (I don't have sudo access).
The python version that I have is Python-2.7.10.

In the source code directory of h5py-2.4.0 I type in:

python setup.py install --user

But I get this which in the end it fails to install it:

running install
running bdist_egg
running egg_info
writing requirements to h5py.egg-info/requires.txt
writing h5py.egg-info/PKG-INFO
writing top-level names to h5py.egg-info/top_level.txt
writing dependency_links to h5py.egg-info/dependency_links.txt
reading manifest file 'h5py.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'h5py/defs.pyx'
warning: no previously-included files found matching 'h5py/defs.pxd'
warning: no previously-included files found matching 'h5py/config.pxi'
writing manifest file 'h5py.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Traceback (most recent call last):
 File "setup.py", line 147, in <module>
   cmdclass = CMDCLASS,
 File "/tools/python/Python-2.7.10/Lib/distutils/core.py", line 151, in setup
   dist.run_commands()
 File "/tools/python/Python-2.7.10/Lib/distutils/dist.py", line 953, in run_commands
   self.run_command(cmd)
 File "/tools/python/Python-2.7.10/Lib/distutils/dist.py", line 972, in run_command
   cmd_obj.run()
 File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 67, in run
 File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 109, in do_egg_install
 File "/tools/python/Python-2.7.10/Lib/distutils/cmd.py", line 326, in run_command
   self.distribution.run_command(command)
 File "/tools/python/Python-2.7.10/Lib/distutils/dist.py", line 972, in run_command
   cmd_obj.run()
 File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 160, in run
 File "build/bdist.linux-x86_64/egg/setuptools/command/bdist_egg.py", line 146, in call_command
 File "/tools/python/Python-2.7.10/Lib/distutils/cmd.py", line 326, in run_command
   self.distribution.run_command(command)
 File "/tools/python/Python-2.7.10/Lib/distutils/dist.py", line 972, in run_command
   cmd_obj.run()
 File "build/bdist.linux-x86_64/egg/setuptools/command/install_lib.py", line 10, in run
 File "/tools/python/Python-2.7.10/Lib/distutils/command/install_lib.py", line 111, in build
   self.run_command('build_ext')
 File "/tools/python/Python-2.7.10/Lib/distutils/cmd.py", line 326, in run_command
   self.distribution.run_command(command)
 File "/tools/python/Python-2.7.10/Lib/distutils/dist.py", line 972, in run_command
   cmd_obj.run()
 File "/tools/h5py-2.4.0/setup_build.py", line 99, in run
   from Cython.Build import cythonize
ImportError: No module named Cython.Build



My question is do I need to install Cython?

Kinds regards,
Sam

Pierre Complex

unread,
Aug 12, 2015, 6:30:38 AM8/12/15
to h5py
Hi,

Yes, you need Cython. This information can be found in the documentation of h5py http://docs.h5py.org/en/latest/build.html

It is not straightforward to install h5py from scratch. The recommendation is to use a package manager. Some will install gladly in your home directory (without administrator access), for instance the Enthought one or Anaconda.

Regards,

Pierre
Reply all
Reply to author
Forward
0 new messages