Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove packages from local pypi index

This is similar to this question with one exception. I want to remove a few specific versions of the package from our local pypi index, which I had uploaded with the following command in the past.

python setup.py sdist upload -r <index_name>

Any ideas?

like image 400
Indrajeet Avatar asked Jun 19 '14 14:06

Indrajeet


People also ask

Can you remove a package from pypi?

Login. Go to your packages. Check the "remove" checkbox for the particular package. Click "Remove" button.

How do I remove unused PIP packages?

You can install and use the pip-autoremove utility to remove a package plus unused dependencies.

What is Devpi?

devpi is a meta package installing two other packages: devpi-server: for serving a pypi.python.org consistent caching index as well as local github-style overlay indexes. devpi-web: plugin for devpi-server that provides a web and search interface.


3 Answers

As an addenum from @jan-vlcinsky's answer

Removing from pypiserver

Using curl for instance:

curl --form ":action=remove_pkg" --form "name=<package_name>" --form "version=<version>" <pypiserver_url>
like image 78
Emmanuel Sciara Avatar answered Oct 21 '22 20:10

Emmanuel Sciara


I'm using pypiserver and had to remove a bad package so I just SSH'd in and removed the bad packages and restarted the service.

The commands were roughly:

ssh root@pypiserver
cd ~pypiserver/pypiserver/packages
rm bad-package*
systemctl restart pypiserver.service

That seemed to work fine for me, and you can just remove what you need using standard shell commands. Just be sure to restart the process so it refreshes its index.

like image 20
AndrewWhalan Avatar answered Oct 21 '22 20:10

AndrewWhalan


Removing packages from local pypi index depends on type of pypi index you use.

removing package from devpi index

devpi allows removing packages only from so called volatile indexes. Non-volatile are "release like" indexes and removing from them is not allowed (as you would surprise users depending on released package).

E.g. for package pysober version 0.2.0:

$ devpi remove -y pysober==0.2.0

removing package from public pypi

is described in the answer you already refered to.

removing package from other indexes

Can vary, but in many cases you can manually delete the files (with proper care).

like image 11
Jan Vlcinsky Avatar answered Oct 21 '22 18:10

Jan Vlcinsky