简体   繁体   中英

ValueError: unsupported pickle protocol: 3, python 2.7 cannot load pickle file even dump with protocol = 2

I have used: pickle.dump(data, f, protocol=2)

And try to open the pickle file with python 2.7, however, it still pop up with the error "ValueError: unsupported pickle protocol: 3".

It is more likely to be a pickle file created with python 3. I guess you mainly use python 2.7. Either you re-create the pickle file with python 2.7 or you use python 3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM