I firstly dump some stuff into a pickle file using pickle.dump. in utils.load_data, my project hierarchy looks like this
project1
-utils
-__init__.py
-load_data.py
-data
(other folder...)
Then it outputs a pickle file into a data folder. Then I move the .pickle file to another project, the project hierarchy is
project2
-data
-main.py
When I run a pickle.load() operation in this main.py, it prompts the error as the title. However, if I move main.py back to project1 folder, then the error disappears. So the issue must be from the file.
My question is, why does pickle try to import the package from where it was born? Could anyone share a good explanation for this? I got quite confused.