distutils IndexError:元组索引超出范围

时间:2018-03-16 20:32:29

标签: python installation pip setup.py

当发生这种情况时,我试图将library上传到https://pypi.org

Traceback (most recent call last):
  File "setup.py", line 44, in <module>
    keywords=['producti-gestio', 'python', 'api', 'rest'],
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in 
run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in 
run_command
    cmd_obj.run()
  File "/usr/lib/python3.6/distutils/command/upload.py", line 64, in 
run
    self.upload_file(command, pyversion, filename)
  File "/usr/lib/python3.6/distutils/command/upload.py", line 158, in 
upload_file
    value = valve[1]
IndexError: tuple index out of range

我不确切知道发生了什么,我检查了我图书馆的所有文件,但一切都很好! (我希望)

setup.py

from distutils.core import setup

url = 'https://github.com/pyTeens/producti-gestio/archive/v0.3.0.tar.gz',

setup(
    name='producti_gestio',
    packages=['producti_gestio',
              'producti_gestio.core',
              'producti_gestio.decorator',
              'producti_gestio.project',
              'producti_gestio.server',
              'producti_gestio.utils'],
    version='0.3.0',
    description='A new simple web server',
    author='Gabriel Hearot',
    author_email='gabriel@hearot.it',
    url='https://github.com/pyTeens/producti-gestio',
    download_url=url,
    scripts=['bin/producti-gestio'],
    keywords=['producti-gestio', 'python', 'api', 'rest'],
)
你能帮帮我吗?谢谢。

1 个答案:

答案 0 :(得分:3)

删除最后的逗号,它使url元组类型。 download_urlurl需要字符串

url = 'https://github.com/pyTeens/producti-gestio/archive/v0.3.0.tar.gz',

示例:

>>> url = 'http://abc',
>>> type(url)
<type 'tuple'>