【发布时间】:2020-09-10 22:42:59
【问题描述】:
我尝试在 python3 中导入 gensim 库。
所有库都是最新版本。
在第一次导入中得到一个TypeError: expected bytes, Descriptor found
并在第二次导入时出现此错误:
import gensim
> AttributeError Traceback (most recent call last)
<ipython-input-7-e70e92d32c6e> in <module>
----> 1 import gensim
~\Anaconda3\lib\site-packages\gensim\__init__.py in <module>
3 """
4
~\Anaconda3\lib\site-packages\smart_open\transport.py in <module>
20 NO_SCHEME = ''
21
---> 22 _REGISTRY = {NO_SCHEME: smart_open.local_file}
23
24
AttributeError: module 'smart_open' has no attribute 'local_file'
【问题讨论】:
-
您使用什么命令安装
gensim? (看起来您使用的是 Anaconda;您是如何设置工作环境的?如果您创建一个新环境并重试,是否会出现同样的错误?) -
(另外,如果可以复制:生成原始
TypeError的确切事件序列和代码是什么,以及该错误的完整显示堆栈?)
标签: python import typeerror gensim attributeerror