我已经安装了libbz 2-dev,但是在导入gensim时仍然出现以下导入错误:
>>> import gensim
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/krishna/gensimenv/lib/python2.7/site-packages/gensim/__init__.py", line 6, in <module>
from gensim import parsing, matutils, interfaces, corpora, models, similarities, summarization
File "/home/krishna/gensimenv/lib/python2.7/site-packages/gensim/corpora/__init__.py", line 14, in <module>
from .wikicorpus import WikiCorpus
File "/home/krishna/gensimenv/lib/python2.7/site-packages/gensim/corpora/wikicorpus.py", line 21, in <module>
import bz2
ImportError: No module named bz2
2条答案
按热度按时间ohfgkhjo1#
你可以试着做
owfi6suc2#
我遇到了同样的问题,上面的提示没有解决这个问题。也许在创建虚拟环境之前,您需要:
相关:missing python bz2 module