简体   繁体   English

如何从Pypi中删除包

[英]How to remove a package from Pypi

How do I remove a package from Pypi? 如何从Pypi中删除包裹?

I uploaded a package to Pypi several months ago. 几个月前我上传了一个包给Pypi。 The package is now obsolete and I'd like to formally remove it. 包裹现在已经过时了,我想正式删除它。 I cannot find any documentation on how to remove my package. 我找不到有关如何删除我的包的任何文档。

  • Login. 登录。
  • Go to your packages. 转到你的包裹。
  • Check the "remove" checkbox for the particular package. 选中特定包的“删除”复选框。
  • Click "Remove" button. 单击“删除”按钮。

New PYPI Website 新的PYPI网站

在此输入图像描述

  1. Login to pypi.org 登录pypi.org
  2. Go to releases 转到发布
  3. Click delete on options dropdown 单击选项下拉列表上的delete
  4. Enter the version number confirm 输入版本号确认
  5. Click Delete Release to delete the release. 单击“ Delete Release以删除版本。





original answer 原始答案

Login in to pypi , select the required package from Your packages 登录pypi ,从Your packages选择所需的包

To delete only a version of the package. 仅删除程序包的某个版本。

select Remove? 选择Remove? check box on the individual package version that you want to delete, and click remove. 单击要删除的单个程序包版本上的复选框,然后单击“删除”。

在此输入图像描述

To delete the package completely 完全删除包

Scroll down until you see the red box saying Do NOT use this button and click Remove this project completely and on the next page, confirm your action. 向下滚动,直到看到红色框说“ 不要使用此按钮”并单击“完全删除此项目”,然后在下一页上确认您的操作。 Don't forget that, there is no undo option . 不要忘记,没有撤消选项

在此输入图像描述

This is not a really good idea, because all users of the previous package will see their install fails. 这不是一个好主意,因为前一个软件包的所有用户都会看到他们的安装失败。

If you want to deprecate a package, what you can do is publish a last release with a README pointing to the new package. 如果要弃用程序包,可以执行的操作是使用指向新程序包的README发布最后一个发行版。 I did that for python-cli-ui , which is replaced by cli-ui 我为python-cli-ui做了那个,它被cli-ui取代

If you want to get fancy you can also: 如果你想获得幻想,你也可以:

  • Add a warning printed when setup.py is run 运行setup.py时添加警告
  • or at import time 或在进口时
  • or replace the package by a dummy one that depends on the new name. 或者用一个取决于新名称的虚拟包替换包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM