Tips for VSCode
Select Python Virtual Environments
Ctrl + Shift + p
Then, find Python : Select Interpreter
After selecting the environment, VScode will automatically choose it for python coding.
Create a Python Virtual Environment
- Create a
Project
folder - In the Project, Open Terminal. If a virtual environment is running, Stop it with
conda deactivate
- Create a virtual environment named "pyenv"
python -m venv pyenv
- VScode will show it noticed a new virtual environment, and you can find pyenv folder in the Project Explorer
- Activate the environment : Type
pyenv\Scripts\activate.bat
. You can find it in the environment folder - Make a requirement.txt file for installing requirement libraries. Just list library names and versions. ex) flask==1.0.0 request math stats gunicorn>=1.1.2,<2.0
- Then
pip install -r requirement.txt
- Create a Jupyter file, test.ipynb. Then, use it.