Rasa修改为中文报错

rasa修改为中文后,在命令行输入非中文字符报错。

错误:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/gzit000633/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Users/gzit000633/anaconda3/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/gzit000633/Documents/Python/cca_chatbot/virtualenv_ccac/lib/python3.6/site-packages/rasa_core/channels/console.py", line 97, in record_messages
    text = get_cmd_input()
  File "/Users/gzit000633/Documents/Python/cca_chatbot/virtualenv_ccac/lib/python3.6/site-packages/rasa_core/channels/console.py", line 36, in get_cmd_input
    text = input().strip()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 12: invalid continuation byte

解决方案:

修改文件【Python安装路径】/site-packages/rasa_core/channels/console.py,在开头加上

# -*- coding: utf-8 -*-

 

你可能感兴趣的:(安装报错)