如何找到pickle文件中使用的Spacy和python版本?

2024-04-26 20:36:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我想打开几个月前转储的以下pickle文件,但出现以下错误

dataset_s = pickle.load(open("dataset_s.pickle",'rb'))

AttributeError: Can't get attribute 'cluster' on <module 'spacy.lang.lex_attrs' from ...

另外,当我想要import我使用的包时,我会得到以下警告

DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in 
    the future. Please pass the result to `transformed_cell` argument and any exception 
    that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 
    and above, and should_run_async(code)

有人能帮我解决这些问题吗


Tags: and文件theruninasync错误load
1条回答
网友
1楼 · 发布于 2024-04-26 20:36:14

如果您是从Github获取此文件,很可能他们有一个名为requirements.txt的文件,其中描述了包的版本要求

根据您使用的环境,您甚至可以使用不同的方法设置环境,以便根据requirements.txt自动更新/反转:

警告不会影响您当前的运行,但最好根据警告更改代码,使其与包的未来版本兼容。或者,您也可以保存版本信息,并在将来反向使用旧版本包

相关问题 更多 >