pip can not uninstall packages in a virtualenv

Bug #1392288 reported by Lars Hansson
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-pip (Debian)
Fix Released
Unknown
python-pip (Ubuntu)
Fix Released
Undecided
Unassigned
Utopic
Confirmed
Undecided
Unassigned

Bug Description

Expected behaviour: pip will uninstall packages in a virtualenv
What happens:

lars@skalman:~$ mkvirtualenv test
Running virtualenv with interpreter /usr/bin/python2
New python executable in test/bin/python2
Also creating executable in test/bin/python
Installing setuptools, pip...done.
(test)lars@skalman:~$ pip install redis
Downloading/unpacking redis
  Downloading redis-2.10.3.tar.gz (86kB): 86kB downloaded
  Running setup.py (path:/home/lars/.virtualenvs/test/build/redis/setup.py) egg_info for package redis

    warning: no previously-included files found matching '__pycache__'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
Installing collected packages: redis
  Running setup.py install for redis

    warning: no previously-included files found matching '__pycache__'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
Successfully installed redis
Cleaning up...
(test)lars@skalman:~$ pip freeze -l
redis==2.10.3
(test)lars@skalman:~$ pip uninstall redis
Can't uninstall 'redis'. No files were found to uninstall.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: python-pip-whl 1.5.6-2
ProcVersionSignature: Ubuntu 3.16.0-24.32-generic 3.16.4
Uname: Linux 3.16.0-24-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Nov 13 20:04:25 2014
InstallationDate: Installed on 2014-11-13 (0 days ago)
InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
PackageArchitecture: all
SourcePackage: python-pip
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Lars Hansson (romabysen) wrote :
Revision history for this message
Stefano Rivera (stefanor) wrote :

Fixed in 1.5.6-3, uploaded to vivid today.

Changed in python-pip (Ubuntu):
status: New → Fix Released
Revision history for this message
Lars Hansson (romabysen) wrote :

Is this going to be backported to Utopic too?

Revision history for this message
Leonardo Donelli (learts92) wrote :

Workarounds? this is kind of a big bug.

Revision history for this message
Stephen Oliver (steveatinfincia) wrote :

Agreed, this is rather serious, this bug has caused production deploy scripts to fail for us at a bad time (naturally...).

On the other hand, this package is in the universe repository (i.e. unsupported) rather than main. Odd given how important pip is, but oh well.

It's simple enough to fix though, just uninstall the package and easy_install pip to get the newest version (6.x, don't know why the versions jump like that, but they do), which works fine on Utopic.

Revision history for this message
Stephen Oliver (steveatinfincia) wrote :

I knew there had to be a better way than resorting to easy_install, and it looks like the "official" way to get pip if it...

a) isn't included as a part of the python version installed

b) isn't available from the package manager (or isn't usable, in this case)

... is to use the get-pip.py script, which includes a zipped copy of it.

Normally I'd never install a python module without using dpkg/apt or with pip inside a virtualenv, but this is a bit of a special case installing pip itself to replace an unusable packaged version.

Instructions here: https://pip.pypa.io/en/latest/installing.html

David Planella (dpm)
Changed in python-pip (Ubuntu Utopic):
status: New → Confirmed
Changed in python-pip (Debian):
status: Unknown → Fix Released
Revision history for this message
Andrew Somerville (andy-somerville) wrote :

Shouldn't the bug watcher bot post a link to the fix artifact when it marks "Fix Released"?

Revision history for this message
Andrew Somerville (andy-somerville) wrote :

And will this be back-ported? It currently affects at least 14.10, (and possibly 14.04?)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.