问题复现如下:
Traceback (most recent call last):
File "read.py", line 2, in
test=pd.read_pickle("test_df.pkl")
File "/home/appleyuchi/.virtualenvs/python3.6/lib/python3.6/site-packages/pandas/io/pickle.py", line 180, in read_pickle
return try_read(path, encoding='latin1')
File "/home/appleyuchi/.virtualenvs/python3.6/lib/python3.6/site-packages/pandas/io/pickle.py", line 175, in try_read
lambda f: pc.load(f, encoding=encoding, compat=True))
File "/home/appleyuchi/.virtualenvs/python3.6/lib/python3.6/site-packages/pandas/io/pickle.py", line 149, in read_wrapper
return func(f)
File "/home/appleyuchi/.virtualenvs/python3.6/lib/python3.6/site-packages/pandas/io/pickle.py", line 175, in
lambda f: pc.load(f, encoding=encoding, compat=True))
File "/home/appleyuchi/.virtualenvs/python3.6/lib/python3.6/site-packages/pandas/compat/pickle_compat.py", line 212, in load
return up.load()
File "/usr/lib/python3.6/pickle.py", line 1050, in load
dispatch[key[0]](self)
File "/usr/lib/python3.6/pickle.py", line 1347, in load_stack_global
self.append(self.find_class(module, name))
File "/home/appleyuchi/.virtualenvs/python3.6/lib/python3.6/site-packages/pandas/compat/pickle_compat.py", line 135, in find_class
return super(Unpickler, self).find_class(module, name)
File "/usr/lib/python3.6/pickle.py", line 1388, in find_class
__import__(module, level=0)
ModuleNotFoundError: No module named 'pandas.core.internals.managers'; 'pandas.core.internals' is not a package
解决方案:
python3 -m pip install --upgrade pandas