Error reading "pickle" file, no module named 'Data'
The program that created the pickle file did import Data
and there are references to that module inside the pickled object. The program that loads the pickled object needs to be able to import that module to resolve those references. Either put the location of Data.py on your PYTHONPATH (or add the location to sys.path
), or copy the module to where your program can find it.
Related videos on Youtube
![Bolat Tleubayev](https://i.stack.imgur.com/7F031.jpg?s=256&g=1)
Bolat Tleubayev
Artificial Intelligence MSc from KU Leuven. Interested in Machine/Deep Learning and Computer Vision
Updated on June 04, 2022Comments
-
Bolat Tleubayev about 2 years
I tried to read pickle file using Anaconda Navigator and have the following script.
import pickle import sys, os with open('pickle1', 'rb') as fp: data_new = pickle.load(fp)
After running the window I get the following error window.
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-4-047bee0f1247> in <module>() 3 4 with open('pickle1', 'rb') as fp: ----> 5 data_new = pickle.load(fp) ModuleNotFoundError: No module named 'Data'
Can you please help me fix this issue? I tried to rename file to *.pkl, and *.csv formats, but it did not help. Original data file has no extension of its own.
-
Bolat Tleubayev over 5 yearsThanks! I work on my colleague's code, so I didn't know about Data.py file