【问题标题】:Can't upload package to PyPI anymore [duplicate]无法再将包上传到 PyPI [重复]
【发布时间】:2018-01-30 18:41:32
【问题描述】:

我正在尝试将一个包 (https://github.com/chembl/standardiser) 上传到 PyPI,我做了很多次都没有任何问题。

我使用安装了 Python 2.7.13 的 conda 环境。

1.第一次尝试:

    python setup.py sdist upload

错误:

Submitting dist/standardiser-0.1.9.tar.gz to https://pypi.python.org/pypi
Upload failed (410): Gone (This API has been deprecated and removed from legacy PyPI in favor of using the APIs available in the new PyPI.org implementation of PyPI (located at https://pypi.org/). For more information about migrating your use of this API to PyPI.org, please see https://packaging.python.org/guides/migrating-to-pypi-org/#uploading. For more information about the sunsetting of this API, please see https://mail.python.org/pipermail/distutils-sig/2017-June/030766.html)
error: Upload failed (410): Gone (This API has been deprecated and removed from legacy PyPI in favor of using the APIs available in the new PyPI.org implementation of PyPI (located at https://pypi.org/). For more information about migrating your use of this API to PyPI.org, please see https://packaging.python.org/guides/migrating-to-pypi-org/#uploading. For more information about the sunsetting of this API, please see https://mail.python.org/pipermail/distutils-sig/2017-June/030766.html)

2。第二次尝试:

    python setup.py sdist upload -r https://www.python.org.pypi

错误:

error: <urlopen error [Errno 8] nodename nor servname provided, or not known>

3.第三次尝试系统范围的 Python 2.7.3:

    python setup.py sdist upload

Error:

    Creating tar archive
    removing 'standardiser-0.1.9' (and everything under it)
    running upload
    Submitting dist/stardiser-0.1.9.tar.gz to https://upload.pypi.org/legacy
    error: None

包仍然不在 PyPI 中

4.第四次尝试

按照https://packaging.python.org/guides/migrating-to-pypi-org/#uploading 中的描述创建~/.pypirc 文件

     [distutils]
     index-servers =
       pypi

     [pypi]
     repository:https://pypi.python.org/pypi
     username:MY_ACTUAL_USERNAME
     password:MY_ACTUAL_PASSWORD

并运行:

python setup.py sdist upload

错误:同1。

5.第五次尝试

~/.pypirc 中删除repository:https://pypi.python.org/pypi

并运行:

python setup.py sdist upload

错误:同1。

6.第六次尝试

旧版~/.pypirc

    [distutils]
    index-servers =
    pypi

    [pypi]
    repository: https://upload.pypi.org/legacy/
    username: MY_ACTUAL_USERNAME
    password: MY_ACTUAL_PASSWORD

并运行:

python setup.py sdist upload

错误:同1。

任何其他提示如何将我的包上传到 PyPI?

【问题讨论】:

    标签: python upload package pypi


    【解决方案1】:

    Pypi API 似乎不再支持上传命令...

    如果您想将项目上传到 Pypi,请使用 Twine。 该文档可在此处获得https://pypi.python.org/pypi/twine

    【讨论】:

    • 不客气! Pypi 需要更新他们关于这一点的文档...
    猜你喜欢
    • 2018-07-26
    • 2017-12-25
    • 2017-11-14
    • 2020-05-03
    • 2018-10-10
    相关资源
    最近更新 更多