Skip to content

Bug on windows cmd for character encoding #1464

@FlowDownTheRiver

Description

@FlowDownTheRiver

Describe the bug

Traceback (most recent call last):
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\Scripts\interpreter.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\interpreter\terminal_interface\start_terminal_interface.py", line 610, in main
    start_terminal_interface(interpreter)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\interpreter\terminal_interface\start_terminal_interface.py", line 449, in start_terminal_interface
    interpreter.computer.vision.load()
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\interpreter\core\computer\vision\vision.py", line 31, in load
    self.easyocr = easyocr.Reader(
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\easyocr\easyocr.py", line 92, in __init__
    detector_path = self.getDetectorPath(detect_network)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\easyocr\easyocr.py", line 253, in getDetectorPath
    download_and_unzip(self.detection_models[self.detect_network]['url'], self.detection_models[self.detect_network]['filename'], self.model_storage_directory, self.verbose)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\easyocr\utils.py", line 628, in download_and_unzip
    urlretrieve(url, zip_path, reporthook=reporthook)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 277, in urlretrieve
    reporthook(blocknum, bs, size)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\easyocr\utils.py", line 728, in progress_hook
    print(f'\r{prefix} |{bar}| {percent}% {suffix}', end='')
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\colorama\ansitowin32.py", line 47, in write
    self.__convertor.write(text)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\colorama\ansitowin32.py", line 177, in write
    self.write_and_convert(text)
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\colorama\ansitowin32.py", line 205, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\lib\site-packages\colorama\ansitowin32.py", line 210, in write_plain_text
    self.wrapped.write(text[start:end])
  File "C:\Users\break\AppData\Local\Programs\Python\Python310\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 '\u2588' in position 12: character maps to <undefined>

This is on windows 10 cmd.

Chagpt suggestion :

https://chatgpt.com/share/66f2abeb-5178-8005-b1d4-4b5c055b7a27

Can you please fix this?

Reproduce

have used this :
pip install open-interpreter[local]
tried to use ollama models for vision
on cmd : interpreter --local -y -vi

or when I use this :
interpreter --local -y
select ollama
then a vision model like llava
again I get the same error.

Expected behavior

I want the character encoding problem to be fixed.

Screenshots

No response

Open Interpreter version

0.3.13

Python version

3.10.11

Operating System name and version

windows 10

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs VerificationIssue needs to be reproduced with the latest version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions