【问题标题】:HDF5 ImportError with PyTables for Windows适用于 Windows 的 PyTables 的 HDF5 ImportError
【发布时间】:2017-11-21 19:17:31
【问题描述】:

我已经在我能想到的每个目录中安装了 HDF5.dll 和 HDF5dll.dll——PYTHONPATH、USERPROFILE,在 PyTables 站点包文件夹中——我仍然返回以下错误:

ImportError: Could not load any of ['hdf5.dll', 'hdf5dll.dll'], please ensure that it can be found in the system path

这两个肯定都在系统路径中,如果没有此消息,我仍然无法测试 PyTables。有谁知道如何解决这个问题?谢谢!

【问题讨论】:

    标签: python dll hdf5 pytables


    【解决方案1】:

    我在Python 3.6.0 (x64)Windows 10 下也有同样的错误。有趣的是,根据 Google 搜索,有报道称自 2017 年 6 月以来 Python 3 的表格已损坏,而且显然尚未修复。

    但是,我可以在Windows 10 下的Python 2.7.13 (x64) 中导入表。所以看看你是否可以在Python 2.7下运行你的脚本。

    【讨论】:

      【解决方案2】:

      我从 PyPI 安装了 PyTables 3.5.2 并得到了

      "Fail: ImportError: HDFStore requires PyTables, "Could not load any of ['hdf5.dll', 'hdf5dll.dll'],请确保可以在系统路径中找到它"

      尝试使用 pandas.read_hdf() 时。然后我点击 https://www.pytables.org/usersguide/installation.html 上的链接到 Christoph Gohlkes 页面 https://www.lfd.uci.edu/~gohlke/pythonlibs/ 并从那里下载 tables‑3.5.2‑cp37‑cp37m‑win_amd64.whl。在 pip 卸载/安装之后,现在一切正常。我的路径中仍然没有 hdf5*.dll ...

      【讨论】:

        【解决方案3】:

        我对文档和我浏览的每一篇文章都不满意。我不断得到:

        LINK : fatal error LNK1181: cannot open input file 'hdf5.lib'
        * Using Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]
        * USE_PKGCONFIG: False
        * Found HDF5 using system PATH ('C:\Users\<user>\AppData\Roaming\Python\Python39\site-packages\h5py')
        .. ERROR:: Could not find a local HDF5 installation.
        

        不过,这确实成功了:

        复制 hdf5.dll 到 C:\Users\AppData\Roaming\Python\Python39\site-packages\tables

        最新的 dll 可以在这里找到:https://pypi.org/project/h5py/#files:

        pip install -U C:\downloads\h5py-3.1.0-cp39-cp39-win_amd64.whl
        

        我确实在某个阶段将 h5py 添加到了我的 Windows 路径中。

        例如:C:\Users\AppData\Roaming\Python\Python39\site-packages\h5py

        但我无法确认其影响。

        【讨论】:

          猜你喜欢
          • 2013-08-27
          • 2021-03-27
          • 2015-10-10
          • 2011-12-21
          • 2012-04-03
          • 2020-12-04
          • 2020-02-15
          • 2015-10-21
          • 2019-06-15
          相关资源
          最近更新 更多