Virtual Environments (venv)
Last updated
Last updated
Let's say we have 2 Projects that use different versions of FastAPI
Let's say Project 2 uses a newer version of FastAPI than Project 1 and there are breaking changes between the 2 versions
You have a problem now where you need 2 different versions of the FastAPI framework and you are not able to upgrade
This is an isolated environment that will not be affected by any other changes
It is completely isolated to this project
Navigate to the folder where you want to create the VENV
Use the following command to set up the VENV
In our case we will be using VSCode
Go to View --> Command Palette
Go to Select interpreter
Enter the path to the interpreter
This should be remembered every time you enter the project, but if it doesn't, repeat this process
Go to the project folder
Enter the following line:
Note: If done correctly you should have a (venv)
at the beginning of the terminal line
This will not work if you are using Git Bash for Windows
Once you have installed everything that you need to get started within your VENV use the following command
If you are on another machine and require the installation of all dependencies use: