Runnig py -m pip list
in windows powershell, produces:
Package Version
--------------- -------
-umpy 1.15.4
autogui 0.1.8
import subprocess
print((bytes(subprocess.check_output(['pip', 'uninstall', '-umpy'], stderr=subprocess.STDOUT)).decode()))
To automate it in a python script.
Try
py -m pip uninstall -- -umpy
Double dashes separate options from non-options; used exactly in case like this.
BTW, I don't think -umpy
is a real package. It seems it's a leftover from an unsuccessful uninstallation of a package numpy
.
It could be you need to remove its directories manually. To do that, type py -m pip list -v
to get a list of all installed modules together with their installation location and then simply delete the corresponding folders.