About environment mangement and .venv folder
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
Issue
I found that poetry prefer using .venv
folder inside as the virtual environment of project. But this behavior is not described in doc. I think it will be good to write down this.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (9 by maintainers)
Top Results From Across the Web
venv — Creation of virtual environments — Python 3.11.1 ...
python3 -m venv /path/to/new/virtual/environment. Running this command creates the target directory (creating any parent directories that don't exist ...
Read more >Python Virtual Environments: A Primer
This folder is where you'll install external packages that you want to use within your virtual environment. By default, your virtual environment ...
Read more >Python virtualenv and venv dos and don'ts - InfoWorld
When you set up a virtual environment, the directory it lives in isn't meant to hold anything but the virtual environment itself. Your...
Read more >Pipenv & Virtual Environments
virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need. It can be...
Read more >Introduction to Python Virtual Environments and Dependency ...
A virtual environment is an isolated Python environment where a project's dependencies are installed in a different directory from those ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree that this is not an intuitive behavior.
I think we should make a distinction between the
virtualenvs.in-project
setting is not set (and keep the current behavior of using the local.venv
virtual environment in this case) and if it’s set explicitly toFalse
.That way, we make sure that it’s possible to tell Poetry to not use the
.venv
virtual environment.@etijskens: You have
virtualenvs.in-project = true
in your config.poetry
then creates the venv within the project and calls the folder.venv
. The name is hardcoded.@azdkj532: Ah, I see now. I guess this is a bug. If
virtualenvs.in-project = false
is set, poetry shouldn’t look for.venv
within the project folder.Reopen this issue.
Thanks for reporting!
fin swimmer