Browse code

Workaround pip10 uninstall of packages

As noted in comments, this is a hack to get pip10 to overwrite some
package installed libraries.

Change-Id: Iea24a3ea915e13f7e0882144028ec5ff5bfdfae1

Ian Wienand authored on 2018/04/20 09:42:07
Showing 1 changed files
... ...
@@ -202,7 +202,19 @@ function fixup_fedora {
202 202
             # install requests with the bundled urllib3 to avoid conflicts
203 203
             pip_install --upgrade --force-reinstall requests
204 204
         fi
205
+
205 206
     fi
207
+
208
+    # Since pip10, pip will refuse to uninstall files from packages
209
+    # that were created with distutils (rather than more modern
210
+    # setuptools).  This is because it technically doesn't have a
211
+    # manifest of what to remove.  However, in most cases, simply
212
+    # overwriting works.  So this hacks around those packages that
213
+    # have been dragged in by some other system dependency
214
+    sudo rm -rf /usr/lib/python2.7/site-packages/enum34*.egg-info
215
+    sudo rm -rf /usr/lib/python2.7/site-packages/ipaddress*.egg-info
216
+    sudo rm -rf /usr/lib/python2.7/site-packages/ply-*.egg-info
217
+    sudo rm -rf /usr/lib/python2.7/site-packages/typing-*.egg-info
206 218
 }
207 219
 
208 220
 function fixup_suse {