Feb-14-2023, 11:56 AM
I use the following method for a new project:
- Create a new directory and make cwd
- create the virtual directory I use:
python -m venv 'Virtual project name'
- You can activate virtual environment inside of VSCode:
- Ctrl/Shift/P
- click on
select interpreter
- choose your newly created virtual environment (will be remembered, for all code in project)
- Ctrl/Shift/P
- when using python from command line, start virtual environment as follows:
- Set cwd to top directory of project
- Issue command (Linux)
. ./venv/bin/activate
- Set cwd to top directory of project