【问题标题】:Pypi upload problems: Must be a valid Python identifierPypi 上传问题:必须是有效的 Python 标识符
【发布时间】:2018-01-06 03:10:28
【问题描述】:

我无法将我的包上传到 pypi。我以前只能使用python setup.py sdist upload -r pypi,但现在这会导致错误:

Upload failed (400): requires: Must be a valid Python identifier.
error: Upload failed (400): requires: Must be a valid Python identifier.

我已经尝试了一些方法来使其正常工作,但是一切都失败了,并出现了同样的错误。

我删除了根目录中当前的distbuildegg 文件夹。然后我将我的包版本号增加了 1 个微版本。我确保我的~/.pypirc 文件是按照说明进行的:

[distutils]
index-servers = 
    pypi


[pypi]
username: c.welsh2
password: ...

并更新了piptwinesetuptools。我使用

创建了一个构建
python setuptools.py bdist_wheel 

/package_root/dist/* 中创建了构建,我尝试使用

twine upload dist/*

我又得到了:

HTTPError: 400 Client Error: requires: Must be a valid Python identifier. for url: https://upload.pypi.org/legacy/

有人知道是什么导致了这个问题吗?

为了完整起见,这是我的设置文件:

from distutils.core import setup
import  setuptools 


#version
MAJOR = 4
MINOR = 0
MICRO = 5

#=======
__version__ = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

setup(
  name = 'PyCoTools',
  packages = ['PyCoTools'], # this must be the same as the name above
  version = __version__,
  description = 'A python toolbox for COPASI',
  author = 'Ciaran Welsh',
  requires=['lxml','argparse','pandas','numpy','scipy','matplotlib.pyplot','scipy','seaborn','sklearn'],
  package_data={'PyCoTools':['*.py','Documentation/*.pdf',
                             'logging_config.conf',
                             'Documentation/*.html','Licence.txt',
                             'ReadMe.md',
                             'Examples/KholodenkoExample/*',
                             'Examples/BioModelsWorkflowVersion1/*',
                             'Scripts/*.py',
                             'Tests/*.py',
                             'Tests/*.cps',
                             'PyCoToolsTutorial/*.pickle',
                             'PyCoToolsTutorial/*.py',
                             'PyCoToolsTutorial/*.ipynb',
                             'PyCoToolsTutorial/*.html',
                             'PyCoToolsTutorial/*.cps']},
  author_email = '--<hidden>',
  ##
  url = 'https://pypi.python.org/pypi/PyCoTools',
  keywords = ['systems biology','modelling','biological',
              'networks','copasi','identifiability analysis','profile likelihood'],
  license='GPL4',
  install_requires=['pandas','numpy','scipy','matplotlib',
                    'lxml'],
  long_description='''Tools for using Copasi via Python and calculating profile likelihoods. See Github page and documentation for more details''')

【问题讨论】:

    标签: python upload setuptools pypi twine


    【解决方案1】:

    原来有一个非常不可原谅的错字。我无法将 matplotlib.pyplot 提供给 requires 参数,因为它被称为 matplotlib

    【讨论】:

      猜你喜欢
      • 2016-12-15
      • 2019-04-07
      • 2018-02-03
      • 1970-01-01
      • 2018-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-14
      相关资源
      最近更新 更多