uv
uv copied to clipboard
Uninstalling then reinstalling a package produces METADATA error
Steps to reproduce:
- Installing some package, let's say
pandas
uv venv env1 -p 3.10
source env1/bin/activate
uv pip install pandas
- Uninstalling it and installing it again:
uv pip uninstall pandas
uv pip install pandas
- Produces the following error:
error: Failed to read metadata for: pandas==2.2.0
Caused by: failed to open file `~/env1/lib/python3.10/site-packages/pandas-2.2.0.dist-info/METADATA`
Caused by: No such file or directory (os error 2)
Am I doing something wrong?
Hm interesting, I can't reproduce this:
❯ source .venv/bin/activate
❯ uv pip install pandas
Resolved 6 packages in 96ms
Downloaded 2 packages in 499ms
Installed 2 packages in 26ms
+ numpy==1.26.4
+ pandas==2.2.0
❯ uv pip uninstall pandas
Uninstalled 1 package in 87ms
- pandas==2.2.0
❯ uv pip install pandas
Resolved 6 packages in 3ms
Installed 1 package in 16ms
+ pandas==2.2.0
Hm, I tried it with different python versions, and still get this.
I tried it on centos 7.9 and RHEL 9.1.
What information could be useful for reproducing this?
I tried running with -v flag, but it does not show anything useful for this issue
It might be useful to see the contents of ~/env1/lib/python3.10/site-packages/pandas-2.2.0.dist-info or similar after the uninstall, and then after the second install.
After the uninstall the folder ~/env1/lib/python3.10/site-packages/pandas-2.2.0.dist-info is empty, but it still exists
After the second install attempt it remains empty.
I tried to manually remove the pandas-2.2.0.dist-info before the second installation attempt, and then the installation succeeded!
So it seems that this folder was not removed during the uninstall, which causes this issue.
Great, that's really helpful! Just confirming: it's totally empty, no dotfiles or anything, right? Will review.
Yes, it is totally empty - nothing shows up with ls -a
Thanks!
Thanks! I have at least one idea here.
I checked it in version 0.1.13, and I don't get this issue anymore. Closing, I guess :)