我这样做的时候得到了这个错误:
from gensim.models import Word2Vec
ImportError: cannot import name 'open' from 'smart_open' (C:\ProgramData\Anaconda3\lib\site-packages\smart_open\__init__.py)然后我这样做了:
import smart_open
dir(smart_open)
['BZ2File','BytesIO','DEFAULT_ERRORS','IS_PY2','P','PATHLIB_SUPPORT','SSLError','SYSTEM_ENCODING','Uri','__builtins__','__cached__','__doc__','__file__','__loader__','__name__','__package__','__path__','__spec__','boto','codecs','collections','gzip','hdfs','http','importlib','io','logger','logging','os','pathlib','pathlib_module','requests','s3','s3_iter_bucket','six','smart_open','smart_open_hdfs','smart_open_http','smart_open_lib','smart_open_s3','smart_open_webhdfs','sys','urlparse','urlsplit','warnings','webhdfs']正如你所看到的,它没有'open‘,所以我应该如何解决这个问题。我试着安装了不同的版本,我也升级了所有的版本。
发布于 2020-06-16 21:54:40
我也得到了同样的错误。我通过更新smart
_
打开到版本2.0.0。
conda智能安装
_
open==2.0.0
或者
pip智能安装
_
open==2.0.0。
发布于 2021-02-28 10:46:19
import smart_open
smart_open.open = smart_open.smart_open
from gensim.models import Word2Vec效果很好。
发布于 2020-11-04 15:02:17
我得到了相同的错误,我通过升级smart解决了这个错误
_
打开最新版本:
或者
https://stackoverflow.com/questions/62181162
复制相似问题