【发布时间】:2019-12-09 10:51:21
【问题描述】:
我想在 python 3.7.4 中做:
并得到这个错误:
我已经试过了:
使用conda 和pip
使用本地windows和windows服务器
多次重新安装不同版本的软件包(例如numpy 和scipy)
from gensim.models import Word2Vec
Traceback(最近一次调用最后一次): 文件“c:/Users/Administrator/Documents/GitHub/contract-criteria-identifier-on-aws/schnelltest.py”,第 1 行,在 导入gensim 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim__init__.py”,第 5 行,在 从 gensim 导入解析,语料库,matutils,接口,模型,相似之处,总结,实用程序 # noqa:F401 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim\parsing__init__.py”,第 4 行,在 从 .preprocessing 导入 (remove_stopwords, strip_punctuation, strip_punctuation2, # noqa:F401 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim\parsing\preprocessing.py”,第 42 行,在 从 gensim 导入实用程序 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim\utils.py”,第 40 行,在 导入 scipy.sparse 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\sparse__init__.py”,第 230 行,在 从 .csr 导入 * 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\sparse\csr.py”,第 13 行,在 从 ._sparsetools 导入(csr_tocsc、csr_tobsr、csr_count_blocks、 ImportError:DLL 加载失败:找不到指定的模块。 PS C:\Users\Administrator\Documents\GitHub\contract-criteria-identifier-on-aws> & C:/Users/Administrator/AppData/Local/Programs/Python/Python37/python.exe c:/Users/Administrator/文档/GitHub/contract-criteria-identifier-on-aws/schnelltest.py 回溯(最近一次通话最后): 文件“c:/Users/Administrator/Documents/GitHub/contract-criteria-identifier-on-aws/schnelltest.py”,第 1 行,在 导入gensim 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim__init__.py”,第 5 行,在 从 gensim 导入解析,语料库,matutils,接口,模型,相似之处,总结,实用程序 # noqa:F401 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim\parsing__init__.py”,第 4 行,在 从 .preprocessing 导入 (remove_stopwords, strip_punctuation, strip_punctuation2, # noqa:F401 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim\parsing\preprocessing.py”,第 42 行,在 从 gensim 导入实用程序 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gensim\utils.py”,第 40 行,在 导入 scipy.sparse 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\sparse__init__.py”,第 230 行,在 从 .csr 导入 * 文件“C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\scipy\sparse\csr.py”,第 13 行,在 从 ._sparsetools 导入(csr_tocsc、csr_tobsr、csr_count_blocks、 ImportError: DLL load failed: 找不到指定的模块。
【问题讨论】:
-
尝试将python添加到您的系统路径,然后尝试使用pip安装它
-
忽略前面的评论,因为用
pip操作conda安装是一个糟糕的主意。仅将pip用于conda不可用的包。也就是说,我会删除 Anaconda 并重新安装它,而不仅仅是软件包。 -
我看到
DLL出错 - 可能它需要您必须手动安装的 C/C++ 库。 -
@furas 如果问题是某些 c/c++ 库,您建议如何解决此问题?
标签: python machine-learning pip gensim word2vec