表包中的命令“ python setup.py egg_info”失败,错误代码为1

Command “python setup.py egg_info” failed with error code 1 with table package

由于某些原因,我试图安装特定版本的python软件包tables==2.4.0。 但是每次我得到错误

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

如果我尝试使用pip install tables,则可以正常工作,并且将安装版本3.4.3的表程序包。 但是我特别需要2.4.02.x

我也检查过

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

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

但是没有成功。我也尝试了virtualenv,这个版本也出现了同样的错误,最新版本运行良好。我在Ubuntu 14.04中将virtualenv用于python版本2.7.12。 有人可以建议我解决这个问题吗?

谢谢。


我认为问题在于您要安装的表的版本(2.4.0)与您已安装的numpy的版本不兼容。 该不兼容是由于表包随附的setup.py中的错误所致。

请参阅以下错误报告https://github.com/PyTables/PyTables/issues/601

报告该错误的人员在此处提供了补丁:https://gist.github.com/prehensilecode/2eb790476c38299e520ce5ea40896e08

为了自己解决此问题,我下载了2.4.0表格包(pip download tables==2.4.0)并将修补程序应用于setup.py

我确保已安装表依赖项(numpy,numexpr和cython),并且还需要确保安装必要的HDF5文件(sudo apt install libhdf5-serial-dev),然后运行:

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

当然,HDF5文件的路径可能与我的不同。

然后从python提示符import tables