python-3.x - pytables 的 DLL 加载失败
问题描述
运行包含 pytables 的代码时出现以下错误:
Traceback (most recent call last):
File "C:\Users\pierr\python354\lib\site-packages\pandas\io\pytables.py", line 469, in __init__
import tables # noqa
File "C:\Users\pierr\python354\lib\site-packages\tables\__init__.py", line 90, in <module>
from .utilsextension import (
ImportError: DLL load failed: The specified procedure could not be found.
...
File "C:\Users\pierr\python354\lib\site-packages\pandas\io\pytables.py", line 472, in __init__
'importing'.format(ex=str(ex)))
ImportError: HDFStore requires PyTables, "DLL load failed: The specified procedure could not be found." problem importing
python 版本 3.5.4 | 表版本 3.4.2 | 窗户 10
解决方案
我有一个类似的问题。当我尝试运行以下代码时:
import pandas as pd
df = pd.read_hdf('some.hdf')
我收到一个错误:
ImportError: Missing optional dependency 'tables'. Use pip or conda to install tables.
即使pytables
模块是使用 conda 和 pip 安装的(最后当然是 as tables
),错误仍然存在。import tables
也没有工作:
from .utilsextension import (
ImportError: DLL load failed: Не найден указанный модуль.
"Не найден указанный модуль"
俄语中的意思"The specified module was not found"
。
我爬进了 Traceback 中最后一个模块所在的文件夹 - '~\AppData\Roaming\Python\Lib\site-packages\tables' 并找到utilsextension.cp37-win_amd64.pyd
了在那里命名的文件。然后我下载Dependency Walker
了实用程序并查看了这个文件。程序说找不到pytables_hdf5.dll
。我在文件夹中找到了这个文件,~\AppData\Roaming\Python\Lib\site-packages\tables\
并通过以下方式将其添加到 PATH 变量中:
os.environ['PATH'] += os.pathsep + os.path.expanduser('~\\AppData\\Roaming\\Python\\Lib\\site-packages\\tables')
之后一切正常,import tables
不再pd.read_hdf
返回错误。希望这对某人有用。
推荐阅读
- android - Android:更新模拟版本后单元测试失败
- python - 'fieldsets[4][1]' Django 中有重复的字段
- java - Java Soap WS 从请求数据中获取空值
- java - 改造多个 JSON 响应
- javascript - 带有气泡菜单扩展的 Tiptap
- python - 随机种子在导入 Salabim 时给出相同的值
- java - 在 Java 方法声明中的方法名称后插入换行符
- java - 更新 minSDK 到 23 后,作为 Jitsi 中的 minSDK(在当前应用中使用),Edittext 字段无法正常工作
- sorting - Grafana 8排序图例
- junit - SpigotMC java.lang.NoSuchMethodError: org.yaml.snakeyaml.LoaderOptions.setMaxAliasesForCollections(I)V