【问题标题】:python3.6: ValueError: unsupported pickle protocol: 5python3.6:ValueError:不支持的pickle协议:5
【发布时间】:2021-10-27 05:48:04
【问题描述】:

我在本地用python3.8开发了个人网站。 当我部署AWS ubuntu ec2服务器时使用了部署在本地的代码文件,当我保存我的博客内容时,出现以下错误。顺便说一下,该站点在已经测试过的python3.6服务器中可以很好地保存。

文件“/home/ubuntu/.local/lib/python3.6/site-packages/whoosh/index.py”,第 123 行,在 open_dir 返回文件索引(存储,架构=架构,​​索引名=索引名) init 中的文件“/home/ubuntu/.local/lib/python3.6/site-packages/whoosh/index.py”,第 421 行 TOC.read(self.storage, self.indexname, schema=self._schema) 文件“/home/ubuntu/.local/lib/python3.6/site-packages/whoosh/index.py”,第 664 行,读取 段 = stream.read_pickle() 文件“/home/ubuntu/.local/lib/python3.6/site-packages/whoosh/filedb/structfile.py”,第 245 行,在 read_pickle 返回 load_pickle(self.file) ValueError:不支持的泡菜协议:5

我想知道是不是本地环境中的文件可能造成的。

【问题讨论】:

    标签: amazon-web-services amazon-ec2 flask-sqlalchemy python-3.6 ubuntu-18.04


    【解决方案1】:

    我已经解决了,只是在本地删除了python3.8版本生成的pickle 5文件。您可以在代码 load_pickle(self.file) 中检测文件名,例如 print(self.file)。您可以获取文件位置和名称。

    【讨论】:

      猜你喜欢
      • 2017-06-14
      • 2023-03-30
      • 2020-11-29
      • 2017-10-01
      • 2016-11-22
      • 1970-01-01
      • 2014-04-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多