问题
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