-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_pickle.UnpicklingError: the STRING opcode argument must be quoted #181
Comments
Hi! You may use this code to change "word_data.pkl" to "word_data_unix.pkl" and then use the new .pkl file on the script "nb_author_id.py": `#!/usr/bin/env python content = '' print("Done. Saved %s bytes." % (len(content)-outsize))` dos2unix.py addapted from: Copied this answer as this was originally answered by @monkshow92 . Kudos to him |
Can you please explain the above line you have written,and how to implement it. |
The issue is about what kind of "newlines" are used in the different kind of character formats/operating systems. In computer systems, text is saved as binary data using certain encodings. The end of a line is written in different codes for different encoding/OSs. That seems to be the issue at stake here. Monkshow92 and hat20 wrote a small Python script (see above) which changes the one format into the other. I've updated it a bit, so that you can use the name of the original file and the name of a new file (in which the newline characters have been changed) on the command line: _#!/usr/bin/env python import sys original = sys.argv[1] content = '' print("Done. Saved %s bytes." % (len(content)-outsize))_ Please save the code (the text in italics) in a file (e.g. dos2unix.py) and execute it with: python dos2unix.py sourcefile destinationfile where you need to replace "sourcefile" by the name and location of the file that you're trying to read and "destinationfile" by the name of a new file which you will read instead. |
I want to create a project can you help me I'm with 0 knowledge 🤒😭 |
Hello every1 in Win10 this fixed it: PowerShell: |
I'm using python 3.8. Follow this steps to fix the issue.
|
sir you explained really well but after trying this as well i am facing this error kindly help me to resolve such issue. |
Thank you so much @vkaushik189 |
Thank you so much. I was stucked for over 4hours until I stumbled on this. |
@vkaushik189 Thank you! That worked for me:) |
Worked Perfectly. Thanks ;) @austinnoah92 |
I fixed the issue using #181 (comment) and changing the name of the path in the 'email_preprocess.py' file |
thank you, finally worked |
Thanks man @vkaushik189 worked for me as well. Python 3.7 Create a file named "doc2unix.py" in the directory /tools/ import sys original = 'word_data.pkl' content = '' print("Done. Saved %s bytes." % (len(content)-outsize)) The email_preprocess file has certain errors related to python libraries. CHanged a couple of lines in the email_preprocess file to resolve the errors: #!/usr/bin/python import pickle from sklearn.model_selection import train_test_split def preprocess(words_file = "../tools/word_data_unix.pkl", authors_file="../tools/email_authors.pkl"):
|
Thanks a lot, @vkaushik189 it helped. I was tucked in it from 1 day :) |
This can be fixed permanently using a
|
File "../tools\email_preprocess.py", line 36, in preprocess
word_data = pickle.load(words_file_handler)
_pickle.UnpicklingError: the STRING opcode argument must be quoted
How to resolve this error??
Please help!
The text was updated successfully, but these errors were encountered: