【问题标题】:(install gym environment) UnicodeDecodeError: 'utf-8' codec can't decode byte(安装gym环境) UnicodeDecodeError: 'utf-8' codec can't decode byte
【发布时间】:2020-07-01 11:21:51
【问题描述】:

当我尝试安装我的自定义 OpenAI 健身房环境 gym-foo 时,我收到此错误

输入: pip install -e gym-foo

输出:

Obtaining file:///home/gym-foo
    ERROR: Command errored out with exit status 1:
     command: /home/.conda/envs/torch/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/gym-foo/setup.py'"'"'; __file__='"'"'/home/gym-foo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /scratch/6368105.1.gpu.q/pip-pip-egg-info-gtys289c
         cwd: /home/gym-foo/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/.conda/envs/torch/lib/python3.6/codecs.py", line 321, in decode
        (result, consumed) = self._buffer_decode(data, self.errors, final)
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 41: invalid start byte
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我找到了有关 unicode 错误的解决方案,但我一点也不熟悉 unicode/ascii 术语。有没有人能快速解决?

注意:我已运行 pip install -U setuptools,据我所知,我编写的代码中没有非 ASCII 字符。

【问题讨论】:

    标签: python unicode ascii codec openai-gym


    【解决方案1】:

    尝试升级你的点子:

    pip install -U pip
    

    这对我有用。

    【讨论】:

    • 在执行安装之前设置 python 编码怎么样? export PYTHONIOENCODING=utf8
    猜你喜欢
    • 2013-11-11
    • 2022-01-13
    • 1970-01-01
    • 2021-11-24
    • 2020-12-26
    • 1970-01-01
    • 1970-01-01
    • 2021-09-23
    相关资源
    最近更新 更多