pyenv virtualenvs
命令,那么您应该能够运行以下命令:
假设该列表来自运行pyenv virtualenvs
命令,那么您应该能够运行
pyenv uninstall 3.8.2/envs/greenhouse
删除 3.8.2/envs/greenhouse
环境。
环境本身应该是 pyenv root
运行时返回的子目录。尝试执行 cd $(pyenv root)
,然后查看 versions/
和 versions/{version}/envs/
子目录。
有关详细信息,请参阅文档。
pyenv virtualenv-delete <venv-name>
- 删除虚拟环境。除了Chris的回答外,你可能还需要删除本地的.python-version
文件:
$ pyenv uninstall 3.8.12/envs/test_venv
pyenv-virtualenv: remove /home/user1/.pyenv/versions/3.8.12/envs/test_venv? (y/N) y
$ python -V
pyenv: version 'test_venv' is not installed (set by /home/user1/.python-version)
$ rm .python-version
rm: remove regular file '.python-version'? y
$ python -V
Python 3.8.12