1

我一直在尝试关注此页面顶部的 rasa 安装。第一个安装命令返回正常: pip install rasa-x --extra-index-url https://pypi.rasa.com/simple 但是当我运行时rasa init,我收到以下错误消息:

Traceback (most recent call last):
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Uzay\AppData\Local\Programs\Python\Python37\Scripts\rasa.exe\__main__.py", line 9, in <module>
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\rasa\__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\rasa\cli\scaffold.py", line 159, in run
    print_success("Welcome to Rasa! \U0001f916\n")
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\rasa\cli\utils.py", line 147, in print_success
    print_color(*args, color=bcolors.OKGREEN)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\rasa\cli\utils.py", line 143, in print_color
    print (wrap_with_color(*args, color=color))
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 41, in write
    self.__convertor.write(text)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 162, in write
    self.write_and_convert(text)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 187, in write_and_convert
    self.write_plain_text(text, cursor, start)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 195, in write_plain_text
    self.wrapped.write(text[start:end])
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 41, in write
    self.__convertor.write(text)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 162, in write
    self.write_and_convert(text)
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 190, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\site-packages\colorama\ansitowin32.py", line 195, in write_plain_text
    self.wrapped.write(text[start:end])
  File "c:\users\uzay\appdata\local\programs\python\python37\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f916' in position 17: character maps to <undefined>

我一直在查看创建此问题的 rasa 文件,该文件名为scaffold.py,它包含许多表情符号,包括引发错误的这一行: print_success("Welcome to Rasa! \U0001f916 \n")

long\U0001f916是脚手架文件中有很多表情符号的编码。我已尝试注释掉该行并删除表情符号,但错误仍然存​​在。有谁知道我该如何解决这个问题?

4

0 回答 0