2
votes

After I upgraded python2 to python3.7, I cannot use pandas to load hdf files any more. The following codes had no problems before, but after updating to python3.7, I got error message of "Can't determine version for tables."

My python version is 3.7, but there are still previous python2.7 paths. Please see the following:

$ python --version

Python 3.7.3

$ whereis python

python: /usr/bin/python /usr/bin/python2.7 /usr/bin/python2.7-config /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /home/yun.wei/anaconda3/bin/python /home/yun.wei/anaconda3/bin/python3.7 /home/yun.wei/anaconda3/bin/python3.7-config /home/yun.wei/anaconda3/bin/python3.7m /home/yun.wei/anaconda3/bin/python3.7m-config /usr/share/man/man1/python.1.gz

Is this error due to old python versions?

import pandas as pd
filename = 'filename.h5'
df = pd.read_hdf(filename, key='data', mode='r')

ImportError: Can't determine version for tables

1

1 Answers

0
votes

I ran into this error because I did not have pytables installed. I solved it by running

conda install pytables

Or if you use pip you should be able to run

pip install tables