使用python3.4
w / pip
尝试安装django-floppyforms==1.1
并获得此non-ASCII payload error
。我python2.7
没有收到此错误。发生了什么事?
Downloading/unpacking django-floppyforms==1.1 (from -r ../requirements/base.txt (line 22))
Downloading django_floppyforms-1.1-py33-none-any.whl (51kB): 51kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/commands/install.py", line 274, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/req.py", line 1206, in prepare_files
for subreq in dist.requires(req_to_install.extras):
File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2236, in requires
dm = self._dep_map
File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2429, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2451, in _compute_dependencies
for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
File "/home/admin/.virtualenvs/py3/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py", line 2421, in _parsed_pkg_info
self._pkg_info = Parser().parsestr(self.get_metadata(self.PKG_INFO))
File "/usr/local/lib/python3.4/email/parser.py", line 70, in parsestr
return self.parse(StringIO(text), headersonly=headersonly)
File "/usr/local/lib/python3.4/email/parser.py", line 60, in parse
return feedparser.close()
File "/usr/local/lib/python3.4/email/feedparser.py", line 170, in close
self._call_parse()
File "/usr/local/lib/python3.4/email/feedparser.py", line 163, in _call_parse
self._parse()
File "/usr/local/lib/python3.4/email/feedparser.py", line 449, in _parsegen
self._cur.set_payload(EMPTYSTRING.join(lines))
File "/usr/local/lib/python3.4/email/message.py", line 311, in set_payload
" payload") from None
TypeError: charset argument must be specified when non-ASCII characters are used in the payload
Storing debug log for failure in /tmp/tmpletnstcp
答案 0 :(得分:6)
这是由Python-3.4.0b3
中的错误造成的。此错误已修复2014-02-07 18:30(http://bugs.python.org/issue20531)。
您可以Python-3.4.0rc1
使用email
或通过Python 3.4.0b3
复制Python-3.4.0rc1
$ pip install django-floppyforms==1.1
Downloading/unpacking django-floppyforms==1.1
Downloading django_floppyforms-1.1-py33-none-any.whl (51kB): 51kB downloaded
Installing collected packages: django-floppyforms
Successfully installed django-floppyforms
确认{{1}}。
我刚刚在挤压时用{{1}}对其进行了测试,并成功安装了包:
{{1}}