简体   繁体   English

UnicodeDecodeError: 'charmap' 编解码器| pip python-stdnum==1.8安装时出错

[英]UnicodeDecodeError: 'charmap' codec| Error during installation of pip python-stdnum==1.8

I am fairly new to programming, so please bear with me.我对编程很陌生,所以请多多包涵。

While I was installing some required packages for a module that I'm using, I wasn't able to install python-stdnum==1.8 .当我为正在使用的模块安装一些必需的软件包时,我无法安装python-stdnum==1.8

I got the following error message:我收到以下错误消息:

File "C:\Users\59996\AppData\Local\Programs\Python\Python37\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 0x9d in position 967: character maps to <undefined>
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Is there anything I can do to still be able to install the package?我可以做些什么来仍然能够安装 package?

Any help would be greatly appreciated.任何帮助将不胜感激。 Thanks in advance!提前致谢!

If it's for the Odoo 14 install on Windows, the issue is in the "requirements.txt"如果是用于 Windows 上的 Odoo 14 安装,则问题在“requirements.txt”中

Change "python-stdnum==1.8" to "python-stdnum==1.8.1" (even if the answer of Federico Baù is working by the way)将 "python-stdnum==1.8" 更改为 "python-stdnum==1.8.1" (即使 Federico Baù 的答案是顺便说一句)

then another issue will appear so change "psutil==5.6.6" to "psutil==5.6.7" still in the "requirements.txt"然后会出现另一个问题,因此将“psutil==5.6.6”更改为“psutil==5.6.7”仍在“requirements.txt”中

source: https://github.com/odoo/odoo/issues/62919来源: https://github.com/odoo/odoo/issues/62919

Best regards此致

I ran to the same problem while installing Odoo Dependencies in Windows, but after some tacke I found a solution.我在 Windows 中安装 Odoo 依赖项时遇到了同样的问题,但经过一番努力,我找到了解决方案。

It's a old bug with stdnum 1.8 --> stdnum 1.8 installation fails on windows .这是stdnum 1.8的一个老错误 -->在 windows 上安装 stdnum 1.8 失败

Solution解决方案

  1. Go to arthurdejong.org/python-stdnum/ and findpython-stdnum-1.8.tar.gz Go 到arthurdejong.org/python-stdnum/并找到python-stdnum-1.8.tar.gz

  2. Download the Zip in a folder, rename it from python-stdnum-1.8.tar.gz to python-stdnum-1.8.tar_.gz (Just to avoid name collision).将 Zip 下载到一个文件夹中,将其从python-stdnum-1.8.tar.gz重命名为python-stdnum-1.8.tar_.gz (只是为了避免名称冲突)。

  3. Then create the following Python Script (in the same directory):然后创建如下 Python 脚本(在同一目录下):


import tarfile

def open_tarfile_function(tarfile_file_name):
    open_tarfile=tarfile.open("python-stdnum-1.8.tar_.gz")
    open_tarfile.extractall(path='stdnum')
    open_tarfile.close()

open_tarfile_function('data.tgz')

  1. It will create a folder named stdnum, open it and then open setup.py , go to line 37 and modify from this:它将创建一个名为 stdnum 的文件夹,打开它,然后打开setup.py , go 到第 37 行并从中修改:

with open(os.path.join(base_dir, 'README'), 'r') as fp:
    long_description = fp.read()

To this:对此:

with open(os.path.join(base_dir, 'README'), 'rb') as fp:
    long_description = fp.read().decode('utf-8')

Save it.保存。

  1. Now in the same Directory run this code:现在在同一个目录中运行以下代码:

import tarfile
import os.path

def make_tarfile(output_filename, source_dir):
    with tarfile.open(output_filename, "w:gz") as tar:
        tar.add(source_dir, arcname=os.path.sep)

output_filename = "python-stdnum-1.8.tar.gz"
source_dir = "stdnum\python-stdnum-1.8"

make_tarfile(output_filename, source_dir)

  1. This will create file python-stdnum-1.8.tar.gz copy the Absolute Path这将创建文件python-stdnum-1.8.tar.gz复制绝对路径

  2. Go to your Python Environment and run: Go 到您的 Python 环境并运行:


pip install D:\Odoo\Odoo_instance_one\python-stdnum-1.8.tar.gz

Obviously replace the Absolute Path with your absolute path.显然用您的绝对路径替换绝对路径。

First,you can use the online installation, use the command pip install python-stdnum==1.8 .首先,您可以使用在线安装,使用命令pip install python-stdnum==1.8

Second,you can download whl file of python-stdnum from here .其次,您可以从这里下载 python-stdnum 的 whl 文件。

For example download to F:/file .例如下载到F:/file

Then use command pip install F:/file/python_stdnum-1.15-py2.py3-none-any.whl to install.然后使用命令pip install F:/file/python_stdnum-1.15-py2.py3-none-any.whl进行安装。

python-stdnum 1.8 is the previous version, there is no corresponding whl file anymore. python-stdnum 1.8是以前的版本,没有对应的whl文件了。

In general, the previous version corresponds to the python version is relatively low, so if you use pip install python-stdnum==1.8 to install, there may be problems, because your current python is 3.7, which is relatively new.一般来说,之前的版本对应的python版本比较低,所以如果你用pip install python-stdnum==1.8来安装,可能会有问题,因为你现在的Z23EEEB4347BDD26BFC6B3EE9A3B755.DD比较新

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Linux上进行pip安装期间出现UnicodeDecodeError - UnicodeDecodeError during pip installation on linux “UnicodeDecodeError:&#39;charmap&#39;编解码器无法解码”pickle load中的错误 - “UnicodeDecodeError: 'charmap' codec can't decode” error in pickle load Python GNP软件包错误:UnicodeDecodeError:&#39;charmap&#39;编解码器无法解码位置4894的字节0x81:字符映射到<undefined> - Python GNP package error: UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 4894: character maps to <undefined> 运行 Python 转换后的 exe 时出错:“UnicodeDecodeError:‘charmap’编解码器无法解码字节”使用 reverse_geocoder - Error when running Python converted exe: "UnicodeDecodeError: 'charmap' codec can't decode byte" using reverse_geocoder 自定义Python Charmap编解码器 - Custom Python Charmap Codec Python 3 UnicodeDecodeError:“charmap”编解码器无法解码字节 0x9d - Python 3 UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d python 无法在 VS 代码中的虚拟环境中启动:UnicodeDecodeError: 'charmap' codec can't decode byte - python unable to start in virtual environment in VS code: UnicodeDecodeError: 'charmap' codec can't decode byte Python-UnicodeDecodeError:“ charmap”编解码器无法解码位置1070的字节0x9d:字符映射到<undefined> - Python - UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1070: character maps to <undefined> Python - UnicodeDecodeError:'charmap' 编解码器无法解码 position 中的字节 0x81 229393:: 字符映射到<undefined></undefined> - Python - UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 229393:: character maps to <undefined> Python JSON到CSV - 编码错误,UnicodeDecodeError:'charmap'编解码器无法解码字节 - Python JSON to CSV - bad encoding, UnicodeDecodeError: 'charmap' codec can't decode byte
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM