[Python-modules-team] Bug#751827: python-virtualenv: version of pip in virtualenvs fails to uninstall some packages

Alexander Clausen alex at gc-web.de
Tue Jun 17 00:45:21 UTC 2014


Package: python-virtualenv
Version: 1.11.6-2
Severity: important

Dear Maintainer,

(I am unsure if this is because of interaction of pip with the virtualenv,
so I am reporting against python-virtualenv, not python-pip. Feel free
to reassign!)

When creating a virtualenv, the version of pip that gets installed does
not properly uninstall some packages. Consider the following script:

----------------->pip_fail.sh>-------------------
#!/bin/sh
set -x
unset PIP_DOWNLOAD_CACHE
virtualenv some_venv
. some_venv/bin/activate
pip install six==1.4.1
pip uninstall -y six
pip freeze
ls -la $VIRTUAL_ENV/lib/python2.7/site-packages/
ls -la $VIRTUAL_ENV/lib/python2.7/site-packages/six*egg*
cat $VIRTUAL_ENV/lib/python2.7/site-packages/six*egg*/installed-files.txt
rm -rf some_venv
-----------------<pip_fail.sh<-------------------

On my system, the uninstall fails with

    Can't uninstall 'six'. No files were found to uninstall.

The installed-files.txt looks allright:

    + cat /tmp/some_venv/lib/python2.7/site-packages/six-1.4.1-py2.7.egg-info/installed-files.txt
    ../six.py
    ../six.pyc
    ./
    top_level.txt
    dependency_links.txt
    SOURCES.txt
    PKG-INFO

Replacing 'six==1.4.1' with 'six==1.5.1' in the script above, the
uninstall completes without error. The obvious difference is that
six==1.5.1 uses a wheel, six==1.4.1 doesn't. Installing pip from pypi,
while keeping six==1.4.1, also fixes the problem:

----------------->pip_win.sh>--------------------
#!/bin/sh
set -x
unset PIP_DOWNLOAD_CACHE
virtualenv some_venv
. some_venv/bin/activate
pip install pip==1.5.4
pip install pip==1.5.6
pip install six==1.4.1
pip uninstall -y six
pip freeze
ls -la $VIRTUAL_ENV/lib/python2.7/site-packages/
ls -la $VIRTUAL_ENV/lib/python2.7/site-packages/six*egg*
cat $VIRTUAL_ENV/lib/python2.7/site-packages/six*egg*/installed-files.txt
rm -rf some_venv
-----------------<pip_win.sh<--------------------

Output of both scripts below.

Thanks,
Alex


----------------->pip_fail.sh output>-------------------
+ unset PIP_DOWNLOAD_CACHE
+ virtualenv some_venv
New python executable in some_venv/bin/python2
Also creating executable in some_venv/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python2
+ . some_venv/bin/activate
++ deactivate nondestructive
++ unset pydoc
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /bin/sh -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/home/alex/some_venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/opt/msp430-gcc-4.4.3/bin/:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
++ PATH=/home/alex/some_venv/bin:/opt/msp430-gcc-4.4.3/bin/:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' x '!=' x ']'
+++ basename /home/alex/some_venv
++ '[' some_venv = __ ']'
+++ basename /home/alex/some_venv
++ PS1='(some_venv)'
++ export PS1
++ alias 'pydoc=python -m pydoc'
++ '[' -n /bin/sh -o -n '' ']'
++ hash -r
+ pip install six==1.4.1
Downloading/unpacking six==1.4.1
  Downloading six-1.4.1.tar.gz
  Running setup.py (path:/home/alex/some_venv/build/six/setup.py) egg_info for package six
    
Installing collected packages: six
  Running setup.py install for six
    
Successfully installed six
Cleaning up...
+ pip uninstall -y six
Can't uninstall 'six'. No files were found to uninstall.
+ pip freeze
argparse==1.2.1
six==1.4.1
wsgiref==0.1.2
+ ls -la /home/alex/some_venv/lib/python2.7/site-packages/
total 304
drwxr-xr-x 8 alex alex   4096 Jun 17 02:38 .
drwxr-xr-x 4 alex alex   4096 Jun 17 02:38 ..
-rw-r--r-- 1 alex alex    126 Jun 17 02:38 easy_install.py
-rw-r--r-- 1 alex alex    320 Jun 17 02:38 easy_install.pyc
drwxr-xr-x 2 alex alex   4096 Jun 17 02:38 _markerlib
drwxr-xr-x 5 alex alex   4096 Jun 17 02:38 pip
drwxr-xr-x 2 alex alex   4096 Jun 17 02:38 pip-1.5.6.dist-info
-rw-r--r-- 1 alex alex 101161 Jun 17 02:38 pkg_resources.py
-rw-r--r-- 1 alex alex 108892 Jun 17 02:38 pkg_resources.pyc
drwxr-xr-x 4 alex alex   4096 Jun 17 02:38 setuptools
drwxr-xr-x 2 alex alex   4096 Jun 17 02:38 setuptools-4.0.1.dist-info
drwxr-xr-x 2 alex alex   4096 Jun 17 02:38 six-1.4.1-py2.7.egg-info
-rw-r--r-- 1 alex alex  20588 Jun 17 02:38 six.py
-rw-r--r-- 1 alex alex  21384 Jun 17 02:38 six.pyc
+ ls -la /home/alex/some_venv/lib/python2.7/site-packages/six-1.4.1-py2.7.egg-info
total 28
drwxr-xr-x 2 alex alex 4096 Jun 17 02:38 .
drwxr-xr-x 8 alex alex 4096 Jun 17 02:38 ..
-rw-r--r-- 1 alex alex    1 Jun 17 02:38 dependency_links.txt
-rw-r--r-- 1 alex alex   80 Jun 17 02:38 installed-files.txt
-rw-r--r-- 1 alex alex 1422 Jun 17 02:38 PKG-INFO
-rw-r--r-- 1 alex alex  121 Jun 17 02:38 SOURCES.txt
-rw-r--r-- 1 alex alex    4 Jun 17 02:38 top_level.txt
+ cat /home/alex/some_venv/lib/python2.7/site-packages/six-1.4.1-py2.7.egg-info/installed-files.txt
../six.py
../six.pyc
./
dependency_links.txt
SOURCES.txt
PKG-INFO
top_level.txt
+ rm -rf some_venv
-----------------<pip_fail.sh output<-------------------

----------------->pip_win.sh output>--------------------
+ unset PIP_DOWNLOAD_CACHE
+ virtualenv some_venv
New python executable in some_venv/bin/python2
Also creating executable in some_venv/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python2
+ . some_venv/bin/activate
++ deactivate nondestructive
++ unset pydoc
++ '[' -n '' ']'
++ '[' -n '' ']'
++ '[' -n /bin/sh -o -n '' ']'
++ hash -r
++ '[' -n '' ']'
++ unset VIRTUAL_ENV
++ '[' '!' nondestructive = nondestructive ']'
++ VIRTUAL_ENV=/home/alex/some_venv
++ export VIRTUAL_ENV
++ _OLD_VIRTUAL_PATH=/opt/msp430-gcc-4.4.3/bin/:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
++ PATH=/home/alex/some_venv/bin:/opt/msp430-gcc-4.4.3/bin/:/home/alex/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
++ export PATH
++ '[' -n '' ']'
++ '[' -z '' ']'
++ _OLD_VIRTUAL_PS1=
++ '[' x '!=' x ']'
+++ basename /home/alex/some_venv
++ '[' some_venv = __ ']'
+++ basename /home/alex/some_venv
++ PS1='(some_venv)'
++ export PS1
++ alias 'pydoc=python -m pydoc'
++ '[' -n /bin/sh -o -n '' ']'
++ hash -r
+ pip install pip==1.5.5
Downloading/unpacking pip==1.5.5
Installing collected packages: pip
  Found existing installation: pip 1.5.6
    Uninstalling pip:
      Successfully uninstalled pip
Successfully installed pip
Cleaning up...
+ pip install pip==1.5.6
Downloading/unpacking pip==1.5.6
Installing collected packages: pip
  Found existing installation: pip 1.5.5
    Uninstalling pip:
      Successfully uninstalled pip
Successfully installed pip
Cleaning up...
+ pip install six==1.4.1
Downloading/unpacking six==1.4.1
  Downloading six-1.4.1.tar.gz
  Running setup.py (path:/home/alex/some_venv/build/six/setup.py) egg_info for package six
    
Installing collected packages: six
  Running setup.py install for six
    
Successfully installed six
Cleaning up...
+ pip uninstall -y six
Uninstalling six:
  Successfully uninstalled six
+ pip freeze
argparse==1.2.1
wsgiref==0.1.2
+ ls -la /home/alex/some_venv/lib/python2.7/site-packages/
total 252
drwxr-xr-x 7 alex alex   4096 Jun 17 02:39 .
drwxr-xr-x 4 alex alex   4096 Jun 17 02:39 ..
-rw-r--r-- 1 alex alex    126 Jun 17 02:39 easy_install.py
-rw-r--r-- 1 alex alex    320 Jun 17 02:39 easy_install.pyc
drwxr-xr-x 2 alex alex   4096 Jun 17 02:39 _markerlib
drwxr-xr-x 6 alex alex   4096 Jun 17 02:39 pip
drwxr-xr-x 2 alex alex   4096 Jun 17 02:39 pip-1.5.6.dist-info
-rw-r--r-- 1 alex alex 101161 Jun 17 02:39 pkg_resources.py
-rw-r--r-- 1 alex alex 108892 Jun 17 02:39 pkg_resources.pyc
drwxr-xr-x 4 alex alex   4096 Jun 17 02:39 setuptools
drwxr-xr-x 2 alex alex   4096 Jun 17 02:39 setuptools-4.0.1.dist-info
+ ls -la '/home/alex/some_venv/lib/python2.7/site-packages/six*egg*'
ls: cannot access /home/alex/some_venv/lib/python2.7/site-packages/six*egg*: No such file or directory
+ cat '/home/alex/some_venv/lib/python2.7/site-packages/six*egg*/installed-files.txt'
cat: /home/alex/some_venv/lib/python2.7/site-packages/six*egg*/installed-files.txt: No such file or directory
+ rm -rf some_venv
-----------------<pip_win.sh output<--------------------


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-virtualenv depends on:
ii  python                 2.7.6-2
ii  python-pip-whl         1.5.6-2
ii  python-pkg-resources   4.0.1-1
ii  python-setuptools-whl  4.0.1-1

Versions of packages python-virtualenv recommends:
ii  virtualenv  1.11.6-2

python-virtualenv suggests no packages.

-- no debconf information



More information about the Python-modules-team mailing list