【问题标题】:How to find the version of Spacy and python used in a pickle file?如何找到泡菜文件中使用的 Spacy 和 python 的版本?
【发布时间】:2020-08-21 23:05:12
【问题描述】:

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

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)

有人可以帮我解决这些问题吗?

【问题讨论】:

    标签: python pickle spacy


    【解决方案1】:

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

    根据您使用的环境,您甚至可以通过不同的方式将环境设置为基于requirements.txt 自动更新/反转:

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

    【讨论】:

    • 我没有从 Github 获得代码。几个月前我自己做的,但我现在打不开。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-30
    • 2021-05-12
    • 1970-01-01
    • 2020-11-02
    • 1970-01-01
    • 2013-09-22
    相关资源
    最近更新 更多