| 网站首页 | 业界新闻 | 群组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
跟大牛学C++学算法数据结构
共有 286 人关注过本帖
标题:用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
2018-12-10 10:39







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

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