'"codec can't encode character" error when I run "pipx install eth-brownie"

Not sure if this helps but I couldn't run "python3 -m pip install --user pipx" and "python3 -m pipx ensurepath". Instead of "python3" I just used "python" and also ran "python -m pipx ensurepath --force"

It told me pipx is ready to go and then I ran "pipx install eth-brownie" and got the below.

C:\Users\gmlad>pipx install eth-brownie

Traceback (most recent call last):
  File "E:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "E:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "c:\users\gmlad\appdata\roaming\python\python310\scripts\pipx.exe\__main__.py", line 7, in <module>
  File "C:\Users\gmlad\AppData\Roaming\Python\Python310\site-packages\pipx\main.py", line 779, in cli
    return run_pipx_command(parsed_pipx_args)
  File "C:\Users\gmlad\AppData\Roaming\Python\Python310\site-packages\pipx\main.py", line 202, in run_pipx_command
    return commands.install(
  File "C:\Users\gmlad\AppData\Roaming\Python\Python310\site-packages\pipx\commands\install.py", line 60, in install
    venv.install_package(
  File "C:\Users\gmlad\AppData\Roaming\Python\Python310\site-packages\pipx\venv.py", line 238, in install_package
    subprocess_post_check_handle_pip_error(pip_process)
  File "C:\Users\gmlad\AppData\Roaming\Python\Python310\site-packages\pipx\util.py", line 349, in subprocess_post_check_handle_pip_error
    print(completed_process.stderr, file=pip_error_fh, end="")
  File "E:\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 '\u2502' in position 559: character maps to <undefined>


Solution 1:[1]

You can try to install brownie by clone from github repository like blow. Then after that you can delete all the code if you want. And you already can use the brownie cli on your computer.

  1. git clone https://github.com/eth-brownie/brownie.git
  2. cd brownie
  3. python3 setup.py install

Solution 2:[2]

Try upgrading pip using:

python -m pip install --upgrade pip

If that doesn't work, then you might need to set your locale to UTF-8. There is a closed GitHub issue on the pipx repo regarding this issue: https://github.com/pypa/pipx/issues/73.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 le_camerone
Solution 2 shreyasm-dev