【pip uninstall 无法卸载】Not uninstalling numpy at /usr/lib/python2.7/dist-packages, outside environment /usr

时间:2022-09-14 06:16:38

想卸载python的库numpy,执行pip uninstall gunicorn,报错如下:

Not uninstalling numpy at /usr/lib/python2.7/dist-packages, outside environment /usr

这是因为当时安装python中的numpy的时候,不是通过pip安装的,而是通过apt安装的,所以需要用apt卸载,而不能用pip卸载,执行:

sudo apt remove python-numpy

https://askubuntu.com/questions/926911/unable-to-uninstall-programs-using-sudo-pip/926914