1

I am trying to install a specific version of python package tables==2.4.0 for some reasons. But every time I am getting the error

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-tJYQ8o/tables/.

If I try with pip install tables, then this works fine and tables package with version 3.4.3 will be installed. But I need specifically 2.4.0 or 2.x.

I have also checked

https://stackoverflow.com/questions/44981793/python-setup-py-egg-info-failed-with-error-code-1

and

https://stackoverflow.com/questions/35991403/pip-install-returns-python-setup-py-egg-info-failed-with-error-code-1

but didn't get success.I also tried virtualenv, the same error is coming with this version and latest version is working fine.I am using virtualenv for python version 2.7.12 in Ubuntu 14.04. Can anybody suggest me for this issue.

Thanks.

Lot_to_learn
  • 590
  • 2
  • 9
  • 21
  • What output does "pip list" produce? – srk May 17 '18 at 14:02
  • @srk: output of `pip list` is `Cython 0.28.2 ez-setup 0.9 numpy 1.14.3 pip 10.0.1 pysam 0.8.0 setuptools 39.1.0 wheel 0.31.1` – Lot_to_learn May 17 '18 at 14:16
  • I found tables doesn't like that version on numpy (1.14.3) when I try to install tables 2.4.0, it wants version 1.4.1 or higher, even though 1.14.3 is higher!!! Maybe you could uninstall numpy 1.14 and install an earlier version like 1.9.0 to trick tables into thinking it has a later version. – srk May 17 '18 at 14:35

1 Answers1

2

I think the problem is that the version of tables you want to install (2.4.0) is not compatible with the version of numpy you have installed. The incompatibility is due to a bug in setup.py that comes with the tables package.

See the following bug report https://github.com/PyTables/PyTables/issues/601

The person that reported the bug provides a patch here: https://gist.github.com/prehensilecode/2eb790476c38299e520ce5ea40896e08

To try and fix this myself I downloaded the 2.4.0 table package (pip download tables==2.4.0) and applied the patch to setup.py

I made sure I had the tables dependencies installed (numpy, numexpr and cython), and you will also need to make sure you install the necessary HDF5 files (sudo apt install libhdf5-serial-dev) then I ran:

sudo python setup.py install --hdf5=/usr/lib/i386-linux-gnu/hdf5/serial/

The path to your HDF5 files may be different to mine of course.

import tablesfrom a python prompt then works

srk
  • 566
  • 1
  • 4
  • 4
  • Sorry for late response. Everything is working well. Tables==2.4.0 is installed but now the problem is that it is not shown in pip list and I am not able to import this package. Here is the output : `running install` `running build` `running build_py` `running build_ext` `running build_scripts` `running install_lib` `running install_scripts` `changing mode of /usr/local/bin/ptdump to 755` `changing mode of /usr/local/bin/ptrepack to 755` `changing mode of /usr/local/bin/nctoh5 to 755` `running install_egg_info` `Writing /usr/local/lib/python2.7/dist-packages/tables-2.4.0.egg-info` – Lot_to_learn May 19 '18 at 06:41
  • Output shown above is when I reinstalled it to confirm that this package is install properly. Output of `pip freeze` is not showing this package and I wonder why if everything is perfect here. Thanks. – Lot_to_learn May 19 '18 at 06:42
  • what error do you get when you try to import tables? – srk May 19 '18 at 11:25
  • :`Traceback (most recent call last):` ` File "", line 1, in ` ` File "tables/__init__.py", line 30, in ` ` from tables.utilsExtension import getPyTablesVersion, ` `getHDF5Version` `ImportError: No module named utilsExtension` – Lot_to_learn May 19 '18 at 11:36
  • when you do the import make sure you aren't in the directory that has tables' setup.py file in it see https://github.com/PyTables/PyTables/issues/395 – srk May 19 '18 at 11:54
  • Sorry again to bother you. I misunderstood last time that setup was complete properly but it didn't. The actual error coming is `ERROR:: Could not find a local HDF5 installation.` but I have checked and confirmed that hdf5 is properly installed by the command (`sudo apt install libhdf5-serial-dev`) mentioned by you. Any suggestions again.... – Lot_to_learn May 25 '18 at 10:33
  • ok do you know where your HDF5 libraries are? Mine are in /usr/lib/i386-linux-gnu/hdf5/serial/ yours maybe in a different location, if you have a 64 bit version of linux it will definitely be in a different location. Once you know where those files are you need to tell setup.py where to find it, thats why you need to run with the --hdf5 argument like this: sudo setup.py install --hdf5= – srk May 25 '18 at 13:31
  • Yes. I found two places where hdf5 files are present. One is '/use/lib/x86_64_linux-gnu/hdf5/serial' where all lub files are present and another is '/use/include/hdf5/serial' where all '.h' and '.mod' files are present. I tried with both address. Second one is definitely not working and correct to put here. So with first one libraries are present but again local installation not present error is shown. Thanks. – Lot_to_learn May 27 '18 at 00:57
  • Edit in previous comment : second one is not correct address to out in the command. – Lot_to_learn May 27 '18 at 04:43