Virtualenv created with pyenv-virtualenv not fully uninstalled
bcvanmeurs opened this issue · comments
Too many issues will kill our team's development velocity, drastically.
Make sure you have checked all steps below.
Prerequisite
- Make sure your problem is not listed in the common build problems.
- Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
- Make sure you are not asking us to help solving your specific issue.
- GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
- Make sure your problem is not derived from packaging (e.g. Homebrew).
- Please refer to the package documentation for the installation issues, etc.
- Make sure your problem is not derived from plugins.
- This repository is maintaining
pyenv
and the defaultpython-build
plugin only. Please refrain from reporting issues of other plugins here.
- This repository is maintaining
Description
- Platform information (e.g. Ubuntu Linux 16.04): macOS 12.5.1
- OS architecture (e.g. amd64): x86_64
- pyenv version: 2.3.4
- Python version: 3.9.7
- C Compiler information (e.g. gcc 7.3):
- Please attach the debug trace of the failing command as a gist:
- Run
env PYENV_DEBUG=1 <faulty command> 2>&1 | tee trace.log
and attachtrace.log
. E.g. if you have a problem with installing Python, runenv PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log
(note the-v
option topyenv install
).
https://gist.github.com/bcvanmeurs/2ec119b39f034a12993d19017bc177cb#file-trace-log
- Run
Pyenv seems not to uninstall everything correctly:
❯ pyenv virtualenv 3.9.7 test
❯ pyenv versions
* system (set by /Users/bram/.pyenv/version)
3.9.7
3.10.5
3.9.7/envs/test
3.10.5/envs/global
* global (set by /Users/bram/.pyenv/version)
test
❯ pyenv uninstall test
pyenv: remove /Users/bram/.pyenv/versions/test? [y|N] y
pyenv: test uninstalled
❯ pyenv versions
* system (set by /Users/bram/.pyenv/version)
3.9.7
3.10.5
3.9.7/envs/test
3.10.5/envs/global
* global (set by /Users/bram/.pyenv/version)
In this example the environment test
is gone but 3.9.7/envs/test
is still there.
But this doesn't work:
❯ pyenv uninstall 3.9.7/envs/test
pyenv: version `test' not installed
test
env is gone here:
❯ ls ~/.pyenv/versions
3.10.5 3.9.7 global
test
env remains here:
❯ ls ~/.pyenv/versions/3.9.7/envs
test
manually removing ~/.pyenv/versions/3.9.7/envs/test
is a workaround
Could this be related to pyenv/pyenv#2432 in 2.3.4?
I have the same issue and it persists in pyenv v2.3.5. Cloning the latest version and checking out v2.3.3 fixes it, so the problem is indeed with the change in 2.3.4.
I just started encountering this issue today as well. Please fix, it is very annoying to have to remove the directory in .pyenv
I just started encountering this issue today as well. Please fix, it is very annoying to have to remove the directory in
.pyenv
For a temporary fix, follow https://github.com/pyenv/pyenv#upgrading to roll back to v2.3.3.
I just started encountering this issue today as well. Please fix, it is very annoying to have to remove the directory in
.pyenv
For a temporary fix, follow https://github.com/pyenv/pyenv#upgrading to roll back to v2.3.3.
I used the automatic installer for installation (https://github.com/pyenv/pyenv-installer). Can you please describe or link to specific instructions on how to update/roll back to a specific version?
I just started encountering this issue today as well. Please fix, it is very annoying to have to remove the directory in
.pyenv
For a temporary fix, follow https://github.com/pyenv/pyenv#upgrading to roll back to v2.3.3.
I used the automatic installer for installation (https://github.com/pyenv/pyenv-installer). Can you please describe or link to specific instructions on how to update/roll back to a specific version?
See here: https://github.com/pyenv/pyenv-installer#install. To make a fresh install, first uninstall pyenv with rm -rf $PYENV_ROOT
(note that this will delete all of your pyenv Python versions and virtual environments). Then set the environment variable export PYENV_GIT_TAG=v2.3.3
and install pyenv with curl https://pyenv.run | bash
followed by exec $SHELL
.
Looks like this is fixed in #438
Looks like this is fixed in #438
Great, thanks!
Any plans on making a new release with this in (Homebrew for macOS still points to 1.1.5) or should we just use HEAD?
Actually, even HEAD fails with:
Error: inreplace failed
/usr/local/Cellar/pyenv-virtualenv/HEAD-c4de255/bin/pyenv-virtualenv-prefix:
expected replacement of "\"${BASH_SOURCE%/*}\"/../libexec" with "/usr/local/Cellar/pyenv-virtualenv/HEAD-c4de255/libexec"
Actually, even HEAD fails with:
Error: inreplace failed /usr/local/Cellar/pyenv-virtualenv/HEAD-c4de255/bin/pyenv-virtualenv-prefix: expected replacement of "\"${BASH_SOURCE%/*}\"/../libexec" with "/usr/local/Cellar/pyenv-virtualenv/HEAD-c4de255/libexec"
okay, a release is in order then