You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no problem reading pickle files with pandas (pd.read_pickle(filename)) using python on the command line (3.7.3; Ubuntu 19.04) but when trying load the very same file from the terminal with ipython (or in a notebook I'm getting:
ValueError: unsupported pickle protocol: 4
The full traceback:
/usr/lib/python2.7/pickle.pyc in load(self)
862 while 1:
863 key = read(1)
--> 864 dispatchkey
865 except _Stop, stopinst:
866 return stopinst.value
/usr/lib/python2.7/pickle.pyc in load_proto(self)
890 proto = ord(self.read(1))
891 if not 0 <= proto <= 2:
--> 892 raise ValueError, "unsupported pickle protocol: %d" % proto
893 dispatch[PROTO] = load_proto
894
ValueError: unsupported pickle protocol: 4
A similar issue pertaining to Python 2/3 was closed but mine seem to differ as I'm able to read the pickle file with python but not with ipython.
The text was updated successfully, but these errors were encountered:
have you find any solutions? I am in the same situation you described, I want to unpickle file directly in Jupyter, but kernel always died after I try to plot the dataframe already retrieved from the pickle object
I have no problem reading pickle files with pandas (pd.read_pickle(filename)) using python on the command line (3.7.3; Ubuntu 19.04) but when trying load the very same file from the terminal with ipython (or in a notebook I'm getting:
/home/rony/.local/lib/python2.7/site-packages/pandas/io/pickle.pyc in read_pickle(path, compression)
177 lambda f: pc.load(f, encoding=encoding, compat=True))
178 try:
--> 179 return try_read(path)
180 except Exception: # noqa: E722
181 if PY3:
/home/rony/.local/lib/python2.7/site-packages/pandas/io/pickle.pyc in try_read(path, encoding)
175 except Exception: # noqa: E722
176 return read_wrapper(
--> 177 lambda f: pc.load(f, encoding=encoding, compat=True))
178 try:
179 return try_read(path)
/home/rony/.local/lib/python2.7/site-packages/pandas/io/pickle.pyc in read_wrapper(func)
146 is_text=False)
147 try:
--> 148 return func(f)
149 finally:
150 for _f in fh:
/home/rony/.local/lib/python2.7/site-packages/pandas/io/pickle.pyc in (f)
175 except Exception: # noqa: E722
176 return read_wrapper(
--> 177 lambda f: pc.load(f, encoding=encoding, compat=True))
178 try:
179 return try_read(path)
/home/rony/.local/lib/python2.7/site-packages/pandas/compat/pickle_compat.pyc in load(fh, encoding, compat, is_verbose)
225 up.is_verbose = is_verbose
226
--> 227 return up.load()
228 except (ValueError, TypeError):
229 raise
/usr/lib/python2.7/pickle.pyc in load(self)
862 while 1:
863 key = read(1)
--> 864 dispatchkey
865 except _Stop, stopinst:
866 return stopinst.value
/usr/lib/python2.7/pickle.pyc in load_proto(self)
890 proto = ord(self.read(1))
891 if not 0 <= proto <= 2:
--> 892 raise ValueError, "unsupported pickle protocol: %d" % proto
893 dispatch[PROTO] = load_proto
894
ValueError: unsupported pickle protocol: 4
A similar issue pertaining to Python 2/3 was closed but mine seem to differ as I'm able to read the pickle file with python but not with ipython.
The text was updated successfully, but these errors were encountered: