- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是一个 Django 项目。在本地 virtualenv 中运行 pip install -r requirements.txt
时遇到错误。
Collecting https://github.com/jedestep/Zappa/archive/layer-support.zip (from -r requirements\base.txt (line 9))
Using cached https://github.com/jedestep/Zappa/archive/layer-support.zip
ERROR: Command errored out with exit status 1:
command: 'c:\users\user~1\desktop\project\project\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize
; sys.argv[0] = '"'"'C:\\Users\\USER~1\\AppData\\Local\\Temp\\pip-req-build-6htw2gh2\\setup.py'"'"'; __file__='"'"'C:\
\Users\\USER~1\\AppData\\Local\\Temp\\pip-req-build-6htw2gh2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(
__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' e
gg_info --egg-base 'C:\Users\USER~1\AppData\Local\Temp\pip-req-build-6htw2gh2\pip-egg-info'
cwd: C:\Users\USER~1\AppData\Local\Temp\pip-req-build-6htw2gh2\
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\USER~1\AppData\Local\Temp\pip-req-build-6htw2gh2\setup.py", line 8, in <module>
long_description = readme_file.read()
File "c:\users\user~1\desktop\project\project\venv\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 73776: character maps to <undefined>
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
要求在 vagrant 环境中按预期安装,但我记得它也可以在我的机器上本地运行。不幸的是,我不确定导致此错误的更改是什么,它可能是拉动的结果。
版本:Python:3.6.5
Django:2.2
点:20.0.2
我已经运行了 pip install --upgrade setuptools
但它并没有改变错误。当我尝试运行 tox
时,自动测试数据库下载会出现类似的错误。
如有任何想法,我们将不胜感激。谢谢。
最佳答案
The requirements do install as expected in the vagrant environment, however I recall that it would also work locally on my machine. Unfortunately, I'm not sure what was the change that lead to this error, it may have been the result of a pull.
问题出在您尝试安装的包以及您的环境配置上。我猜这个包在某一时刻更新并损坏了,因为他们在他们的自述文件中添加了表情符号或其他东西:如果你稍微看一下错误消息,你会发现在将内容读入 long_description
时出现问题,检查 the package's setup.py您可以在开始附近找到问题:
with open('README.md') as readme_file:
long_description = readme_file.read()
这里的问题是,当您打开
文件时没有指定模式,它将是“文本”,因此 python 会自动将字节解码为 str,这很酷,除了 编码 它用于此类解码的是系统的“默认”解码器(通过调用 locale.getpreferredencoding(False)
找到),这通常不是我们想要的。
你的 Vagrant 环境和开发人员的机器可能有一个 UTF8 默认编码(就像现在大多数 unix 系统一样),同时你的本地 Windows 框没有并且默认使用 CP1252,这会爆炸。可悲的是,我不是一个 Windows 用户(对于开发人员),所以我不知道如何更改“默认编码”,考虑到对 SO 的粗略搜索,这甚至可能是不可能的。
我建议:
编码
getpreferredencoding
的内部决策,以及是否可以通过 Windows 中的环境覆盖 preferredencoding(显然可以/很容易覆盖标准流的编码但是chcp
/set PYTHONIOENCODING
显然不对正常的open
做任何事情)PS:我冒昧地更新了你帖子的标签,因为 django、pip 和 eggs 确实与实际问题无关
关于python - Unicode解码错误: 'charmap' codec can't decode byte 0x81 in position 73776,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60200727/
我有以下代码: foreach (byte b in bytes) { byte inv = byte.MaxValue - b; // Add the new value to a
我需要从这个文本文件source.txt中读取内容并将内容反向写入这个文本文件destination.txt。读取和写入必须使用逐字节完成! 我使用 BufferedReader 和 Buffered
我需要存储大量 RGB 颜色对象。对于某些常见用途,这些占用了我的应用程序总内存的 8% 到 12%。我目前将其定义如下: class MyColor { byte red; byte green;
我有一个由字节数组表示的整数。 byte[] result = getResult(); resultInt1 = Integer.parseInt(Bytes.toString(result));/
我正在尝试使用 Rusoto 库调用 AWS Lambda 函数。该请求有一个 JSON 编码的有效负载,我目前将其作为一个字符串,但该库为此坚持使用 bytes::bytes::Bytes 结构。我
我正在尝试基于 Tokio's example 编写一个 TCP 服务器. 当我尝试发送缓冲区时,编译器返回错误 0277。 我的代码:(playground) extern crate tokio;
我知道我可以通过 IList 进行枚举,例如: public byte[] ConvertToByteArray(IList> list) { IList newList = new List
考虑这样一个文本文件: Some text here. --- More text another line. --- Third part of text. 我想把它分成三部分,用---分隔符分开。
如果我有一个字节变量:byte b = 0; 为什么以下工作: b++; b += 1; // compiles ...但这不是吗? b = b + 1; // compile er
我有一个简单的字节数组,我想从中获取颜色。我的计划是用红色表示三位,绿色表示三位,蓝色表示两位。 8 位。 我认为颜色是正确的: 如有错误请指正 byte[] colours = new byte[
我的目标是比较两个字节数组中的两个字符串值。它实际上需要创建两个新的字符串对象才能使用 contains 方法。是选择正确还是有什么办法可以使用优化方式而不使用新的关键字。 if(new String
我正在使用github.com/tarm/serial来连接一些串行仪器。在开发过程中,我使用/dev/ttyp0和/dev/ptyp0对,其中go进程连接到一个,我使用screen连接到另一个。我编
好的,所以如果一个字节是 8 位,那么半字节就是 4 位。并且您可以将四分之一字节作为 2 位(尽管我想,如果有的话,它会被称为双位)。 虽然这是一致的,但如果我使用这个词,有人会感到困惑(或惊讶)吗
我在解释文件时遇到问题。文件构建如下: "name"-@-"date"-@-"author"-@-"signature" 签名是一个字节数组。当我读回文件时,我将其解析为 String 并拆分它: m
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
Java 让我很难过,因为它需要 ArrayList 的包装类秒。我将如何添加 byte[]到 ArrayList ? 最佳答案 LOL 认为我必须包装所有东西。 ArrayList作品。谢谢一晒。
我有一个 16 字节的 md5 散列,我需要使用 XOR 将其“折叠”成 4 字节数据:{1st 4 bytes} XOR {2nd 4 bytes} XOR {3rd 4 bytes} XOR {4
我正在学习SMSC smc91cx驱动代码,我学习了如何根据Application Note 9-6的说明编写smc91c111网卡的测试代码。 .我无法理解“传输数据包”下的以下说明: Write
我必须附加(可变数量的)字节数组。集合似乎只适用于包装类,即 Byte。大约 20 小时后,我想到了这个,并且它有效,但我想知道它是否可以改进(添加到列表,但欢迎任何其他改进建议:),即 Collec
我有两个基本相同的操作: insert_bytes(from, count) delete_bytes(start, stop) -> delete_bytes(from, count) insert
我是一名优秀的程序员,十分优秀!