New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip cannot uninstall from per-user site-packages directory #14

Closed
vbabiy opened this Issue Mar 15, 2011 · 7 comments

Comments

Projects
None yet
1 participant
@vbabiy
Contributor

vbabiy commented Mar 15, 2011

Issue #60 shows the introduction of pip support for package installation to the per-user site-packages directory, which is awesome. Uninstallation of packages in that directory, however, does not yet seem supported, Carl Meyer marked issue #44 as resolved, which seems directly related to this issue, so I found this bug surprising.

Steps to reproduce bug behavior:

Run pip install --user SOMEPACKAGE

Run pip uninstall SOMEPACKAGE

Answer y when pip asks "Uninstalling SOMEPACKAGE: Proceed (y/n)?"

Open a Python console and observe that import SOMEPACKAGE still works; list contents of user site-packages directory and observe package files still there.


@vbabiy

This comment has been minimized.

Show comment
Hide comment
@vbabiy

vbabiy Mar 15, 2011

Contributor

Works fine for me here (pip 0.8.2, using "yolk" as the test package).
Uninstall removes it from my /.local directory just as I'd expect it to.

Reopen if you can provide more details to reproduce.


Original Comment By: Carl Meyer
Contributor

vbabiy commented Mar 15, 2011

Works fine for me here (pip 0.8.2, using "yolk" as the test package).
Uninstall removes it from my /.local directory just as I'd expect it to.

Reopen if you can provide more details to reproduce.


Original Comment By: Carl Meyer
@vbabiy

This comment has been minimized.

Show comment
Hide comment
@vbabiy

vbabiy Mar 15, 2011

Contributor

I am able to reproduce this bug on independent systems, both running Ubuntu
10.04, with pip 0.8.2 as the only version of pip installed on the systems. The
user site-packages directory on Ubuntu is ~/.local/lib/python2.6/site- packages/. I am able to reproduce this bug using all packages tested so far,
including the yolk package.

There is no --verbose option for pip uninstall, so I am not sure what
further details I can provide, however, let me know if you can list some
specifics.


Original Comment By: Chris Lasher
Contributor

vbabiy commented Mar 15, 2011

I am able to reproduce this bug on independent systems, both running Ubuntu
10.04, with pip 0.8.2 as the only version of pip installed on the systems. The
user site-packages directory on Ubuntu is ~/.local/lib/python2.6/site- packages/. I am able to reproduce this bug using all packages tested so far,
including the yolk package.

There is no --verbose option for pip uninstall, so I am not sure what
further details I can provide, however, let me know if you can list some
specifics.


Original Comment By: Chris Lasher
@vbabiy

This comment has been minimized.

Show comment
Hide comment
@vbabiy

vbabiy Mar 15, 2011

Contributor

UninstallPathSet.add() is never called when I execute pip uninstall for
any of these packages in the user site-packages directory.
paths_to_remove.paths is an empty set by the time
paths_to_remove.remove(auto_confirm) is called (line 468 in req.py of
released version 0.8.2).


Original Comment By: Chris Lasher
Contributor

vbabiy commented Mar 15, 2011

UninstallPathSet.add() is never called when I execute pip uninstall for
any of these packages in the user site-packages directory.
paths_to_remove.paths is an empty set by the time
paths_to_remove.remove(auto_confirm) is called (line 468 in req.py of
released version 0.8.2).


Original Comment By: Chris Lasher
@vbabiy

This comment has been minimized.

Show comment
Hide comment
@vbabiy

vbabiy Mar 15, 2011

Contributor

Confirmed bug for Ubuntu 10.10, as well. Carl, on what system are you not able
to reproduce this bug? Maybe the key lies in what paths pip considers in its
search for files and which paths it excludes.


Original Comment By: Chris Lasher
Contributor

vbabiy commented Mar 15, 2011

Confirmed bug for Ubuntu 10.10, as well. Carl, on what system are you not able
to reproduce this bug? Maybe the key lies in what paths pip considers in its
search for files and which paths it excludes.


Original Comment By: Chris Lasher
@vbabiy

This comment has been minimized.

Show comment
Hide comment
@vbabiy

vbabiy Mar 15, 2011

Contributor

I have discovered the tip of the problem, but not the underlying cause, nor
the solution.

When the user runs pip install --user yolk, two directories are placed under
~/.local/lib/python2.6/site-packages: yolk and yolk-0.4.1.egg-info.

The problem is, that when the user runs pip uninstall yolk, pip looks for an
egg info directory called yolk-0.4.1-py2.6.egg-info, not yolk-0.4.1 .egg-info. pip uninstall gets its prediction of the egg info directory name
from a call to pkg_resources.Distribution.egg_name() (line 409), which is
giving 'yolk-0.4.1-py2.6'.

This value is clearly inconsistent with the value for the egg name when its
created under the InstallRequirement.install() method. I haven't been able
to figure out why that's different, given that this falls into the realm of
Distribute, which is being called through subprocess and execfile hackery.
A person more knowledgeable about pip or Distribute could really help in
getting to the etiology of the discrepancy in naming of the egg info
directories during installation and uninstallation.

Note that this discrepancy doesn't occur during pip installation to a
virtualenv, where the egg info directories receive the '-py2.6' portion of
their names during installation.


Original Comment By: Chris Lasher
Contributor

vbabiy commented Mar 15, 2011

I have discovered the tip of the problem, but not the underlying cause, nor
the solution.

When the user runs pip install --user yolk, two directories are placed under
~/.local/lib/python2.6/site-packages: yolk and yolk-0.4.1.egg-info.

The problem is, that when the user runs pip uninstall yolk, pip looks for an
egg info directory called yolk-0.4.1-py2.6.egg-info, not yolk-0.4.1 .egg-info. pip uninstall gets its prediction of the egg info directory name
from a call to pkg_resources.Distribution.egg_name() (line 409), which is
giving 'yolk-0.4.1-py2.6'.

This value is clearly inconsistent with the value for the egg name when its
created under the InstallRequirement.install() method. I haven't been able
to figure out why that's different, given that this falls into the realm of
Distribute, which is being called through subprocess and execfile hackery.
A person more knowledgeable about pip or Distribute could really help in
getting to the etiology of the discrepancy in naming of the egg info
directories during installation and uninstallation.

Note that this discrepancy doesn't occur during pip installation to a
virtualenv, where the egg info directories receive the '-py2.6' portion of
their names during installation.


Original Comment By: Chris Lasher
@vbabiy

This comment has been minimized.

Show comment
Hide comment
@vbabiy

vbabiy Mar 15, 2011

Contributor

I see now that this issue stems from issue #104.

Duplicate of #104.


Original Comment By: Chris Lasher
Contributor

vbabiy commented Mar 15, 2011

I see now that this issue stems from issue #104.

Duplicate of #104.


Original Comment By: Chris Lasher
@vbabiy

This comment has been minimized.

Show comment
Hide comment
@vbabiy

vbabiy Mar 15, 2011

Contributor

Hi Chris, thanks for the debugging legwork here. I am actually on Ubuntu 10.10
myself, but I have setuptools installed manually, not via apt, which is why I
wasn't able to reproduce. Sorry I didn't think of the #104 connection;
the --user thing threw me off.


Original Comment By: Carl Meyer
Contributor

vbabiy commented Mar 15, 2011

Hi Chris, thanks for the debugging legwork here. I am actually on Ubuntu 10.10
myself, but I have setuptools installed manually, not via apt, which is why I
wasn't able to reproduce. Sorry I didn't think of the #104 connection;
the --user thing threw me off.


Original Comment By: Carl Meyer

pfmoore pushed a commit to pfmoore/pip that referenced this issue Oct 24, 2012

Merge pull request pypa#14 from dholth/wheel_build
make sure bdist_wheel is available up front

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment