[英]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 失败。
Go to arthurdejong.org/python-stdnum/ and findpython-stdnum-1.8.tar.gz Go 到arthurdejong.org/python-stdnum/并找到python-stdnum-1.8.tar.gz
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
(只是为了避免名称冲突)。
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')
setup.py
, go to line 37 and modify from this: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.保存。
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)
This will create file python-stdnum-1.8.tar.gz
copy the Absolute Path这将创建文件
python-stdnum-1.8.tar.gz
复制绝对路径
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.