2

I am working in WIN10 , with python 2.7.15

I am try to install package, during the installation process I received the following error .

Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

I try to uninstall with pip (18.1) command and I received the same error.

pip uninstall PyYAML

How I can uninstall/upgrade distutils packge in win10 OS.

darthbith
  • 18,484
  • 9
  • 60
  • 76
MAK
  • 605
  • 9
  • 19

1 Answers1

4

Base distutils functionality doesn't leave any information about which files belong to a package -- thus it cannot be reliably uninstalled. That's what the message is telling you. Moreover, it doesn't have dependency metadata, so it can't be "upgraded" reliably, either. All those features are additions by setuptools (and some by wheel and pip itself).

This can happen if you installed the package directly from source with setup.py install if setup.py is distutils- rather than setuptools-based. Or if you installed it manually from some types of packages by copying/extracting files.


Unless the way you installed it provides an own uninstaller, you'll have to manually figure out which files belong to the package and delete them from Python directories.

Usually, these are:

Generally, look for anything that bears the package's name on it.


If you can build the same package from source, you can use the build process to get a hint: build a binaly package that you can look into (e.g. setup.py bdist_wheel -- .whl is a ZIP archive) and see what files it has in it.

ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152