twitter-sent-dnn icon indicating copy to clipboard operation
twitter-sent-dnn copied to clipboard

WORD2INDEX = pickle.load(open("data/twitter.pkl"))[3] TypeError: a bytes-like object is required, not 'str'

Open mrinal18 opened this issue 7 years ago • 1 comments

i am geting this error everytime i run sentiment.py WORD2INDEX = pickle.load(open("data/twitter.pkl"))[3]

TypeError: a bytes-like object is required, not 'str'

please someone solve this error

mrinal18 avatar Jun 12 '17 07:06 mrinal18

with open("data/twitter.pkl", mode='rb') as f:
    WORD2INDEX = load(f, encoding='bytes')[3]

This works for me (miniconda python 3.6)

rarezhang avatar Apr 03 '18 18:04 rarezhang