【问题标题】:ImportError: Can't determine version for tablesImportError:无法确定表的版本
【发布时间】:2019-10-04 15:03:44
【问题描述】:

我将python2升级到python3.7后,就不能再用pandas加载hdf文件了。以下代码之前没有问题,但更新到python3.7后,出现“无法确定表的版本”的错误消息。

我的python版本是3.7,但是还有以前的python2.7路径。请参阅以下内容:

$ 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

这个错误是因为旧的python版本吗?

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

ImportError: 无法确定表的版本

【问题讨论】:

    标签: pandas python-3.7


    【解决方案1】:

    我遇到了这个错误,因为我没有安装 pytables。我通过运行解决了它

    conda install pytables
    

    或者如果你使用pip你应该可以运行

    pip install tables
    

    【讨论】:

      猜你喜欢
      • 2020-07-15
      • 2021-07-12
      • 1970-01-01
      • 2018-07-28
      • 1970-01-01
      • 2018-04-04
      • 2021-02-28
      • 2015-12-24
      • 2021-12-31
      相关资源
      最近更新 更多