I am developing a program inside a Python virtual environment. Running the command
python -m venv .venv
on Windows, puts the python
symlink in .venv\Scripts\
while
python3 -m venv .venv
on macOS puts the symlinks on .venv/bin/
. I'm using Visual Studio Code for development and there is a .vscode\\settings.json
which needs to point towards the executable's symlinks. For example
{
"python.pythonPath": ".venv\\path\\to\\python",
}
How can I force the venv
to put the symlinks in identical locations regardless of the platform?
P.S.1. The .venv
folder is ignored by git and is included in the .gitignore
file, as AFIK it is not a good practice to ship it with the codebase.
P.S.2. To avoid XY-problem, the final goal is to have an identical development environment on different platforms. Whatever the solution, regardless of the package manager, Visual Studio Code should be able to find the executable's symlinks on different platforms.
P.S.3. I need to find a way to change the __VENV_BIN_NAME__
parameter.
P.S.4. From here, one possible solution might be to use "python.pythonPath": "${env:PYTHON_INSTALL_LOC}",
instead.
P.S.5. I asked another question here.