python – Will the virtual environment created in the directory with the same name by venv be the same environment?

Question: Question:

I'm trying to build using Windows powershell,
When you create a virtual environment file with the same name in two types of files, Desktop \ file1 \ env and Desktop \ file2 \ env,
file1 \ env \ Scripts \ python.exe ・ ・ ・ ① file2 \ env \ Scripts \ python.exe ・ ・ ・ ②
Will it be the same virtual environment if you give it the same name? (For example, when A module is added to ①, A module is also added to ②)

Answer: Answer:

It will be a different virtual environment. Therefore, the package is also different.

Reference: After actually creating each environment and activate it, you can display which environment the current python to by executing the following one-liner.

python3 -c "import sys, os; print(os.path.dirname(sys.executable))"

Scroll to Top