Uninstall pip packages from old Debian installation

111 views Asked by At

I run a Debian system where I had installed several python packages via pip on system level. Now I upgraded to Debian 12. It is now suggested to run each application in a venv environment and install the needed packages locally. This I have done, and it works fine.

However when I call pip list on global level, I still see a lot of installed packages. When I try to uninstall those packages, I get this response:

pip uninstall pyinotify
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

How do I clean up my system?

Tried to uninstall global pip packages. Expected this would work.

0

There are 0 answers