Not able to load a pickle file. I am using python 3.5
import pickle
data=pickle.load(open("D:\\ud120-projects\\final_project\\final_project_dataset.pkl", "r"))
TypeError: a bytes-like object is required, not 'str'
. .
Also tried:
import pickle
data=pickle.load(open("D:\\ud120-projects\\final_project\\final_project_dataset.pkl", "rb"))
UnpicklingError: the STRING opcode argument must be quoted
. .
Same errors even when using with statements
import pickle
with open("D:\\ud120-projects\\final_project\\final_project_dataset.pkl", "rb") as f:
enron_data = pickle.load(f)
I'm using windows 10 and vscode, you should go to the final_project_dataset.pkl file and then change option CRLF to LF and then save the file then
UnpicklingError: the STRING opcode argument must be quoted
error will be disappeared.change CRLF to LF
then save the final_project_dataset.pkl file.