如何解决在已安装的包中出现导入错误 - h5py
得到 h5py 的导入错误,但我已经安装了。但它在 python shell 中工作。
import numpy as np
from urllib.request import urlretrieve
import os
import h5py
if not os.path.isfile('datasets/mini.h5'):
print("Downloading Conceptnet Numberbatch word embeddings...")
conceptnet_url = 'http://conceptnet.s3.amazonaws.com/precomputed-
data/2016/numberbatch/17.06/mini.h5'
urlretrieve(conceptnet_url,'datasets/mini.h5')
with h5py.File('datasets/mini.h5','r') as f:
all_words = [word.decode('utf-8') for word in f['mat']['axis1'][:]]
all_embeddings = f['mat']['block0_values'][:]
我得到的错误:
import h5py
ImportError: DLL load failed while importing _errors: The specified module could not be found.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。