带有PIP的UnicodeDecodeError吗? [英] UnicodeDecodeError with PIP?

查看:105
本文介绍了带有PIP的UnicodeDecodeError吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图分发我的开源项目 Melopy ,但是自从我开始以来,软件包管理就给我带来了麻烦.今天,我注册了PyPI,但是在运行python setup.py sdist upload时遇到以下错误.

I am attempting to distribute my open-source project, Melopy, but package management has been giving me problems since I started. Today, I registered for PyPI, but upon running python setup.py sdist upload I am faced with the following error.

running sdist
running check
reading manifest template 'MANIFEST.in'
not writing to manually maintained manifest file 'MANIFEST'
making hard links in Melopy-0.1.0...
Creating tar archive
Traceback (most recent call last):
  File "setup.py", line 19, in <module>
    setup(**config)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/sdist.py", line 168, in run
    self.make_distribution()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/sdist.py", line 448, in make_distribution
    owner=self.owner, group=self.group)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 392, in make_archive
    owner=owner, group=group)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/archive_util.py", line 237, in make_archive
    filename = func(base_name, base_dir, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/archive_util.py", line 101, in make_tarball
    tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1687, in open
    _Stream(name, filemode, comptype, fileobj, bufsize),
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 431, in __init__
    self._init_write_gz()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 459, in _init_write_gz
    self.__write(self.name + NUL)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 475, in __write
    self.buf += s
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal not in range(128)

setup.py的内容如下.

The contents of setup.py are as follows.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import setup

config = {
    'name': u'Melopy',
    'author': u'Jordan Scales',
    'author_email': u'scalesjordan@gmail.com',
    'description': u'Python music library',
    'long_description': open(u'README.txt').read(),
    'packages': ['melopy'],
    'version': u'0.1.0',
    'url': u'https://github.com/prezjordan/Melopy',
    'license': 'LICENSE.txt',
    'classifiers': []
}

setup(**config)

# Licensed under The MIT License (MIT)
# See LICENSE file for more

推荐答案

似乎您被此错误.从理论上讲,应该通过将版本作为常规字符串传递来解决此问题.

It seems you are being hit by this bug. In theory the problem should be fixed by passing the version as a regular string.

这篇关于带有PIP的UnicodeDecodeError吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆