我正在创建一个python 3应用程序。https://github.com/Omrigan/TED-analysis
要进行部署,我想使用Docker和位于我的Github存储库根目录中的Dockerfile (你可以查看它)。所以,当我做"docker build“时。我在这一行得到一个错误:
RUN pip3 install --upgrade -r /root/ted_talks/requirements.txt来自控制台的日志:
Collecting httpretty==0.8.10 (from smart-open>=1.2.1->gensim->-r /root/ted_talks/requirements.txt (line 4))
Downloading httpretty-0.8.10.tar.gz (41kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-em459e9u/httpretty/setup.py", line 86, in <module>
version=read_version(),
File "/tmp/pip-build-em459e9u/httpretty/setup.py", line 46, in read_version
finder.visit(ast.parse(local_file('httpretty', '__init__.py')))
File "/tmp/pip-build-em459e9u/httpretty/setup.py", line 78, in <lambda>
open(os.path.join(os.path.dirname(__file__), *f)).read()
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 133: ordinal not in range(128)那么,我该怎么做呢?
发布于 2016-04-04 21:17:30
httpretty似乎做了一些时髦的事情来定位它的版本号-它打开一个源文件,其中包含非ascii字符,而没有声明编码。在Python3中,这将使用您的语言环境,在您的情况下,它似乎是损坏的或设置为LANG=C|POSIX。
您有以下选项:
httpretty/__init__.py并删除非ascii字符,将您的地区设置为Python0.8.14,其中提到了兼容Python3。尝试使用以下命令进行安装:pip3安装httpretty==0.8.14
发布于 2016-04-27 11:54:52
我也有同样的问题。原因是我选择的语言环境(即en_US.utf8)没有安装。安装此区域设置解决了我的问题。
要设置地区,请执行以下操作:
locale-gen en_US.utf8
dpkg-reconfigure locales并选择en_US.utf8作为默认语言环境
https://stackoverflow.com/questions/36398996
复制相似问题