标题:用anaconda安装gensim后无法导入
只看楼主
rainit
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2018-11-24
 问题点数:0 回复次数:0 
用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
搜索更多相关主题的帖子: File line module __init__ lib 
2018-12-10 10:39



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-491934-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.186206 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved