I have the following setup: I am on a M1 Mac host machine and am using Ubuntu on a virtual machine created by multipass. The code I work on requires Ubuntu for various reasons I prefer coding on the Mac.
I have created a shared folder which contains the source code of the package and a virtual environment (python3 -m venv environment
) in which I installed the package. I am working on the code using VS Code which allows me to select an interpreter. However, this virtual environment only contains an alias to the binary in the /usr/
folder in the virtual machine (which is not shared with the host).
Is it possible to have the binary in the folder created by venv
? Or is there another way for VS Code to access the binary as the interpreter?
I tried selecting the alias as the interpreter in VS Code but, as expected, this did not work. I also found this article in which the author claims that python3 -m virtualenv
creates its own binary, which I could not confirm (readlink environment/bin/python
outputs /usr/bin/python3
).