The virtual environment created by venv is displayed by "select interpreter" of Visual Studio Code, so make a note of it.
I used venv to create a virtual environment for Python. If it is the latest Python, it is implemented as standard. For more information, click here (https://docs.python.org/ja/3/library/venv.html).
Create a virtual environment. Assuming that multiple virtual environments will be prepared in the future, we prepared a folder called "python_envs" to organize the virtual environments. The name is "mlcv" because it is an environment for machine learning and image processing.
python3 -m venv python_envs/mlcv
Set VS Code to automatically load the virtual environment created in "python_envs".
Open the settings screen with command +,
and search for "venv folders".
Click "Add Item" and enter the path for "python_envs" to complete.
Open the command palette with shift + command + p
and execute "select interpreter" to display a list of Python environments. The virtual environment "mlcv" created earlier has been added at the bottom.
Recommended Posts