installation (or buiding) gives IndexError: list index out of range
gerritholl opened this issue · comments
Inside a Python 3.6 virtual environment on a SUSE Linux Enterprise Server 11, installing the v0.9.2 from the git repository fails with IndexError
as follows:
$ python setup.py install
running install
running bdist_egg
running egg_info
running build_src
build_src
building extension "pyhdf._hdfext" sources
build_src: building npy-pkg config files
writing python_hdf4.egg-info/PKG-INFO
writing dependency_links to python_hdf4.egg-info/dependency_links.txt
writing top-level names to python_hdf4.egg-info/top_level.txt
reading manifest file 'python_hdf4.egg-info/SOURCES.txt'
writing manifest file 'python_hdf4.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'pyhdf._hdfext' extension
compiling C sources
C compiler: gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC
compile options: '-I/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/core/include -I/panfs/e/vol0/gholl/venv/py36/include -I/hpc/rhome/software/python/3.6.5/include/python3.6m -c'
extra options: '-DNOSZIP'
Traceback (most recent call last):
File "setup.py", line 196, in <module>
platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/core.py", line 171, in setup
return old_setup(**new_attr)
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/command/install.py", line 62, in run
r = self.setuptools_run()
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/command/install.py", line 56, in setuptools_run
self.do_egg_install()
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/command/build_ext.py", line 261, in run
self.build_extensions()
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/hpc/rhome/software/python/3.6.5/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/command/build_ext.py", line 379, in build_extension
**kws)
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 92, in <lambda>
m = lambda self, *args, **kw: func(self, *args, **kw)
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 363, in CCompiler_compile
single_compile(o)
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 305, in single_compile
if not _needs_build(obj, cc_args, extra_postargs, pp_opts):
File "/panfs/e/vol0/gholl/venv/py36/lib/python3.6/site-packages/numpy/distutils/ccompiler.py", line 64, in _needs_build
last_cmdline = lines[-1]
IndexError: list index out of range
What version of numpy are you using?
It looks like it's looking for a .d file and then complains because it couldn't find any lines in it. Make sure you have no untracked files (especially files with .d extension) in the git repo.
I'm using numpy 1.16.1.
The working directory is clean:
(py36) gholl@lce00:~/checkouts/python-hdf4> git status
# On branch master
nothing to commit (working directory clean)
(py36) gholl@lce00:~/checkouts/python-hdf4> ls -A
AUTHORS doc .gitignore private-info README_pyhdf setup.cfg
build examples LICENSE pyhdf README.rst setup.py
CHANGES .git MANIFEST python_hdf4.egg-info runexamples.sh .travis.yml
Seems like your python installation is broken. Are you able to build any other python packages that has a C extension?
Note: you can also install pyhdf using conda, to save all the headaches.