1

由于 Google 使用其 apiclient 模块的命名约定,我收到以下错误:

$ sudo ./setup.py install
Traceback (most recent call last):
  File "./setup.py", line 37, in <module>
    scripts = [ 'bin/gsync' ],
  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 225, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 259, in __init__
    getattr(self.metadata, "set_" + key)(val)
  File "/usr/lib/python2.7/distutils/dist.py", line 1220, in set_requires
    distutils.versionpredicate.VersionPredicate(v)
  File "/usr/lib/python2.7/distutils/versionpredicate.py", line 113, in __init__
    raise ValueError("expected parenthesized list: %r" % paren)
ValueError: expected parenthesized list: '-api-python-client'

我如何指示 setuptools 该库不应视为版本谓词,基本上忽略连字符并将所有内容都包含为库名称?

4

1 回答 1

1

我刚刚弄清楚出了什么问题。如果您使用requires = []它,则使用 distutils 样式 setup() 函数中的版本谓词。但是,如果您install_requires = []对列表项进行一些细微更改(版本谓词用空格而不是括号),它就可以正常工作。

于 2013-10-10T12:39:02.220 回答