python - 导入 gensim 并得到一个 TypeError: expected bytes, Descriptor found
问题描述
我尝试在 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'
解决方案
我通过以下步骤解决了这个问题:
pip install smart-open==1.9.0
pip install gensim==3.4.0
这对我有用
推荐阅读
- c# - 屏幕上的边界框正确,但是当我使用相同的矩形获得 Texture2d 时向上移动
- c++ - 引用类型返回函数:如何返回(可选)对象
- python - 带有下拉列表选择器的 Python requests-html
- java - 有没有办法用一种方法而不是两种方法?
- javascript - 平滑扩展 Div 而不滞后
- firebase - 当我运行我的 ionic 3 时,问题 [object object] 显示在 html 页面中
- java - 如何找到成员所属的对象
- php - 如何使用我的标准 Laravel 项目正确设置 MDBootstrap
- python - 更新后Tensorflow极度缓慢
- javascript - D3-桑基未绘制