Python pickling after changing a module's directory

前端 未结 5 1822
生来不讨喜
生来不讨喜 2020-11-30 00:22

I\'ve recently changed my program\'s directory layout: before, I had all my modules inside the \"main\" folder. Now, I\'ve moved them into a directory named after the progra

5条回答
  •  孤街浪徒
    2020-11-30 00:56

    This is the normal behavior of pickle, unpickled objects need to have their defining module importable.

    You should be able to change the modules path (i.e. from tools to whyteboard.tools) by editing the pickled files, as they are normally simple text files.

提交回复
热议问题