-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI command to remove all old environments #1884
Comments
Hello, you can config poetry to put the venv within the project using I don't think it is possible to remove venv where the project does not exists anymore via CLI, because there is no information about where the location of the project was. Having a command to cleanup all venv for an existing project should be possible and seems quite useful to me. fin swimmer |
There could be an option
or it could be
|
Resolved-by: #3212 |
Not sure if this was answered before. After trial and error, I don't quite get how this merge could fix the problem that OP tried to fix. From #3212 I can see that the |
I think there is a misunderstanding of "all old environments for the current project" vs "all old environments" period. Unfortunately the latter is not possible as we use a one-way hash function and there is no way to determine if an environment is still associated with a valid Python project. |
Found this here, because I have the same issue as OP. |
It is not a solution to the problem described by the author. I also find it strange that poetry does not delete virtual environments after deleting the directory with the project. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
tldr: Is there a way to way to clean up old environments en masse?
context: I often spin up a quick project to explore an idea and then tear it down once I'm past the exploration phase. Using
pip
, the environment could be co-located to the project i.e.rm <my_project>
would also remove the environment. With Poetry, environments are located outside the project, and thus it's possible to delete the project without deleting the environment. As a result, you could have environments atpath/to/pypoetry/virtualenvs/
whose projects have been deleted. Currently, Poetry only offers the ability to remove an environment using the CLI from within the project itself; if you've already deleted the project, you need to navigate topath/to/pypoetry/virtualenvs/
and manually remove its hanging environment. It'd be nice if Poetry had a CLI command in which you could remove all environments that no longer correspond to source code directories on the operating system.The text was updated successfully, but these errors were encountered: