【问题标题】:SexMachine install - UnicodeDecodeError: 'charmap' codec can't decode byte in positionSexMachine 安装 - UnicodeDecodeError: 'charmap' 编解码器无法解码位置字节
【发布时间】:2018-11-18 15:24:58
【问题描述】:
(base) C:\Users\sujit>pip install SexMachine
Collecting SexMachine
  Using cached https://files.pythonhosted.org/packages/dd/01/cc5b32af2b3658079736bd865019aeb8db04f9c5764eac72185c276
c/SexMachine-0.1.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Windows\TEMP\pip-install-wlnebm4x\SexMachine\setup.py", line 14, in <module>
        long_description=open('README.rst').read(),
      File "c:\users\sujit\anaconda3\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 835: character maps to <undefined>

Command "python setup.py egg_info" failed with error code 1 in C:\Windows\TEMP\pip-install-wlnebm4x\SexMachine\

我更新了 setuptools 但它没有解决这个问题。

【问题讨论】:

标签: python anaconda


【解决方案1】:

您尝试安装的软件包与 Python 3 不兼容,并在 setup.py 文件中读取非 ASCII 自述文件。您的系统默认编解码器与文件中的 UTF-8 数据不兼容。虽然您可以通过首先设置PYTHONIOENCODING=UTF-8 环境变量来强制解决此问题,但您稍后会遇到其他问题。

您应该安装 gender-guesser project,它使用相同的命令行工具来完成完全相同的工作,但兼容 Python 3:

这是Ferhat ElmasSexMachine 包的一个分支。创建它是为了能够将 Python 3 兼容版本发布到 PyPI,并能够在不打扰原作者的情况下添加更多改进。

【讨论】:

    【解决方案2】:

    试试:pip3 install SexMachine

    如果这不起作用,可以使用以下命令更新 PIP:pip3 install --upgrade pip

    更新 PIP 后,再试试:pip3 install SexMachine

    注意:对于我的回答,我使用了pip3。如果pip3 不起作用,请尝试pip

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-20
      • 2021-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-01
      • 1970-01-01
      相关资源
      最近更新 更多