NOT A DUPLICATE!!! It is NOT A DUPLICATE because: 1. I am using pickle to loads, and not pandas as the original question. 2. upgrading pandas does not help. 3. the original question was using the very same thing the accepted answer suggested. 4. other answers suggest changing the file which is not an option
I have an old pickle file I have to read.
I am reading using
def loads(s):
try:
content = pickle.loads(s)
except TypeError:
content = pickle.loads(str.encode(s), encoding='latin1')
return content
reading the pickle fails the try
(as expected), and then enters the except
.
It then fails with
ModuleNotFoundError: No module named 'pandas.indexes'
How can I read that old pickle?