-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Packages installed using filepaths on Windows mapped drives cannot be uninstalled and exhibit other buggy behavior #8598
Comments
I suspect the non-editable cases are caused by the package name: we should execute For the editable cases, there may be something more interesting going on. Can you locate the |
@chrahunt, you're absolutely right about the uninstall - that is pretty silly of me not to notice, and running the command correctly works. Thanks for the kind reminder. Here are the egg-link contents:
|
Does uninstall work for editable as well? I would expect it to fail, since the reinstall failure happens during the uninstall step. |
@uranusjr , you're right - I didn't think to check uninstalling a package that uses an editable path, and that does fail still:
|
Hi there,
Windows 10, Is there any workaround except from moving the code to a local drive and setting up a new environment? Will this issue be resolved if #9453 could be merged? |
This should be resolved with #11011! :) |
Summary
If you are working on a mapped drive on Windows, if you install a package from a file location (i.e., local repo), you will not be able to uninstall it. If the package was installed using
-e
, attempting to reinstall it will fail with anAssertionError
as well. Based on traceback from that error, the problem appears to be rooted in a faulty comparison between the UNC representation of the path and a non-UNC representation of that same path.Depending on how the install was done (editable vs. noneditable; relative path vs. absolute path) and what operation you're attempting (uninstall vs. install again), the behavior differs.
I saw these problem immediately after upgrading to the recent pip and Python versions listed above. I had not seen any of them on somewhat older versions, although I hadn't tried all of these combinations before - I did some additional testing to try to provide a fuller picture of what's going on. I do know that I've done at least some of these operations successfully on Python 3.7.3 and a fairly recent version of pip - almost certainly a 20.x.x version.
Details
Uninstall
When you attempt to uninstall the package, no matter how you installed it, you will get the output
WARNING: Skipping <package name> because it is not installed.
The output ofpip freeze
indicates that it is still installed. It doesn't appear possible to uninstall the package, which is really unfortunate if the user installed it to their user-level site-packages instead of to a virtual environment.The behavior is the same whether you use a relative path or absolute path to specify the dependency.
"Reinstall"
When you run the exact same install command time, as if to upgrade/reinstall it, one of two things will happen:
AssertionError
which suggests the problem is that the UNC representation of the egg-link is being compared to the standard Windows path (i.e., starting with the mapped drive letter), and bombing out because it doesn't match.The behavior is the same whether you use a relative path or absolute path to specify the dependency.
egg-link contents
Since the error traceback referenced the egglink, here are the contents of one of those that was created while investigating this problem:
Demonstration
Preamble
Editable + relative path
Editable absolute path
Absolute path, non-editable
Relative, non-editable
The text was updated successfully, but these errors were encountered: