I'm having an error related to encoding while trying to run prepare_data.py
Os: Live Lubuntu 20.04
Anaconda environment :
Python 2.7.16
tensorflow 1.4.1
conda 4.10.1
tqdm 4.62.3
colorama 0.4.4
regex 2.5.76
python-Levenshtein
requests 2.24.0
Error after run "prepare_data.py" :
python prepare_data.py
File "prepare_data.py", line 522
SyntaxError: Non-ASCII character '\xe2' in file prepare_data.py on line 522, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
After adding # -*- coding: utf-8 -*- to "prepare_data.py" :
python prepare_data.py
Traceback (most recent call last):
File "prepare_data.py", line 7, in <module>
from core.tokenizer import tokenize
File "/media/lubuntu/TOSHIBA/vit/w/paralel universe3/code/projetos sem pycharm/deb/treinando/nmt-chatbot/core/tokenizer.py", line 36
SyntaxError: Non-ASCII character '\xe2' in file /media/lubuntu/TOSHIBA/vit/w/paralel universe3/code/projetos sem pycharm/deb/treinando/nmt-chatbot/core/tokenizer.py on line 36, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
After adding # -*- coding: utf-8 -*- to "nmt-chatbot/core/tokenizer.py" :
python prepare_data.py
Traceback (most recent call last):
File "prepare_data.py", line 7, in <module>
from core.tokenizer import tokenize
File "/media/lubuntu/TOSHIBA/vit/w/paralel universe3/code/projetos sem pycharm/deb/treinando/nmt-chatbot/core/tokenizer.py", line 13, in <module>
with open(preprocessing['protected_phrases_file'], 'r', encoding='utf-8') as protected_file:
TypeError: 'encoding' is an invalid keyword argument for this function
So i dont know where to go from here. I didnt had this error while trying to run it on python3, but on python 3 i couldnt install tensorflow 1.4, so ... I had to downgrade to python2.7, where i'm having this problem now.
I'm having an error related to encoding while trying to run prepare_data.py Os: Live Lubuntu 20.04 Anaconda environment :
Error after run "prepare_data.py" :
After adding
# -*- coding: utf-8 -*-
to "prepare_data.py" :After adding
# -*- coding: utf-8 -*-
to "nmt-chatbot/core/tokenizer.py" :So i dont know where to go from here. I didnt had this error while trying to run it on python3, but on python 3 i couldnt install tensorflow 1.4, so ... I had to downgrade to python2.7, where i'm having this problem now.