How to remove all pipenv virtualenvs when the directory was deleted?

大憨熊 提交于 2021-01-28 11:21:09

问题


I have a directory A/ containing a Pipfile and a Pipfile.lock obtained by running pipenv install. So this directory has a corresponding virtualenv at /home/username/.local/share/virtualenvs/A-....

Then I delete this A/ directory. Is there a way to check all pipenv virtualenvs, find directories that were deleted and remove the corresponding virtualenvs ?

In this case it should find that A/ was deleted and so remove the virtualenv: /home/username/.local/share/virtualenvs/A-....


回答1:


It seems that there is no way to do it. It's mainly because it's easy to delete all virtualenvs and re-create only the ones you need from their Pipfile. So this feature is not really needed.

See question comments for more details.



来源:https://stackoverflow.com/questions/65126606/how-to-remove-all-pipenv-virtualenvs-when-the-directory-was-deleted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!