A common problem is removing old files from the installed location. eg. version 1 installs. site-packages/packagename/bla.so version 2 installs. site-packages/packagename/_bla.so site-packages/packagename/bla.py However, in version 2 if we install over the top of version 1, distutils does not remove bla.so. Which causes the package to break because bla.so will be used instead of bla.py distutils should be able to be given a list of old files to make sure are removed from the package. It should work with the various installers... msi, dmg etc, as well as when using setup.py install. I've seen this cause breakage with numerous packages. The solution is to hack some old file detection into each package, or tell users 'delete the old install first'. Neither of which is really nice. Specifying an old_files meta data should be able to help.
A uninstall command, based on the record of installed files, will be proposed for #4673. It should adress your problem, since we will be able to add a new option in the install command. I am leaving this issue open so we can keep track of this need.
Jonathan Fernandes started to work on this at the last Montreal sprint. The tests would use install_local_project, which is missing a parameter to control the destination directory (see #14270).
Getting bitten by this with numpy/scipy installations Having previous scipy installed, pip install -I scipy creates a broken scipy installation, because the previous one is not removed and gets overwritten. For instance, an old spectral.so file leftover hides the spectral.py file from the new installation causing broken behavior. Similarly trying pip uninstall scipy pip install scipy does the same, because the distutils uninstall does not uninistall anything, leaves the scipy directory there and all cheerful ends with a 'Successfully uninstalled scipy'. This is *dangerous*. Mixing old and new code could lead to the weirdest behavior. In principle, one could even use this property to craft packages such that when two subsequent versions are installed one on top of the other malicious things happen even if individually each version is innoquous.