Why does hatch not save the virtual environment in the same directory I am working in?

Question:

Why does hatch not save the virtual environment in the same directory I am working in? I went through the doc and couldn’t find a way to achieve that. Maybe it makes sense that it’s that way but I can’t really think why.
Is there a way to create it in the project directory?
Or a good reason to not want to do that?

Asked By: benr

||

Answers:

When you use a tool like hatch, you are basically giving up precise control over the virtual environment in favor of letting hatch manage it for you; this includes letting hatch decide where to keep all such managed environments.

That said, hatch stores virtual environments in a specific data directory that you can specify using the --data-dir option to the hatch command itself.

$ mkdir hatchtest; cd hatchtest
$ ls
$ hatch --data-dir . env create
[...]
$ ls
env

(The default data directory likely varies from platform to platform; it’s ~/Library/Application Support/hatch on my macOS box.)

Answered By: chepner
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.