用anaconda安装gensim后无法导入
我通过pip命令安装了gensim,版本显示3.4,我的python是3.7版本的,numpy和scipy均能正常导入,但是一导入gensim就报错,想请问各位如何解决,谢谢!程序代码:
import gensim Traceback (most recent call last): File "<ipython-input-10-e70e92d32c6e>", line 1, in <module> import gensim File "C:\Users\Rainit\AppData\Roaming\Python\Python37\site-packages\gensim\__init__.py", line 5, in <module> from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401 File "C:\Users\Rainit\AppData\Roaming\Python\Python37\site-packages\gensim\corpora\__init__.py", line 14, in <module> from .wikicorpus import WikiCorpus # noqa:F401 File "C:\Users\Rainit\AppData\Roaming\Python\Python37\site-packages\gensim\corpora\wikicorpus.py", line 534, in <module> class WikiCorpus(TextCorpus): File "C:\Users\Rainit\AppData\Roaming\Python\Python37\site-packages\gensim\corpora\wikicorpus.py", line 570, in WikiCorpus def __init__(self, fname, processes=None, lemmatize=utils.has_pattern(), dictionary=None, File "C:\Users\Rainit\AppData\Roaming\Python\Python37\site-packages\gensim\utils.py", line 1581, in has_pattern from pattern.en import parse # noqa:F401 File "D:\Anaconda\lib\site-packages\pattern\text\en\__init__.py", line 79, in <module> from pattern.text.en import inflect File "D:\Anaconda\lib\site-packages\pattern\text\en\__init__.py", line 80, in <module> from pattern.text.en import wordnet File "D:\Anaconda\lib\site-packages\pattern\text\en\wordnet\__init__.py", line 57, in <module> nltk.data.find("corpora/" + token) File "D:\Anaconda\lib\site-packages\nltk\data.py", line 655, in find return find(modified_name, paths) File "D:\Anaconda\lib\site-packages\nltk\data.py", line 641, in find return ZipFilePathPointer(p, zipentry) File "D:\Anaconda\lib\site-packages\nltk\compat.py", line 221, in _decorator return init_func(*args, **kwargs) File "D:\Anaconda\lib\site-packages\nltk\data.py", line 488, in __init__ zipfile = OpenOnDemandZipFile(os.path.abspath(zipfile)) File "D:\Anaconda\lib\site-packages\nltk\compat.py", line 221, in _decorator return init_func(*args, **kwargs) File "D:\Anaconda\lib\site-packages\nltk\data.py", line 1014, in __init__ zipfile.ZipFile.__init__(self, filename) File "D:\Anaconda\lib\zipfile.py", line 1200, in __init__ self._RealGetContents() File "D:\Anaconda\lib\zipfile.py", line 1267, in _RealGetContents raise BadZipFile("File is not a zip file") BadZipFile: File is not a zip file