How to properly install dependencies in a project?
Properly installing dependencies in a Python project is the key to your application's stability and predictable behavior across different computers or servers. Randomly installing packages into the global system environment inevitably leads to version conflicts and broken projects.
The first step when creating any new project should be isolation via a virtual environment. Create it using the command python -m venv venv, and then activate it: source venv/bin/activate for Linux and macOS, or venv Scripts activate for Windows.
After activating the environment, you can safely install the required libraries.
Following this simple workflow will save you from a lot of headaches during team development and deploying the finished product to production.