Repository navigation
Dependencies and Virtual Environments
This page explains about dependencies in general and Python3 virtual environments. -t external code to work.
To install dependencies we can use different methods, depending on the status of the code we are working with, we will need the first method or the second.
Dependencies in this method are handled manually, if our project is new it's the correct method, if not, this will lead to a dependency hell
pip3 install <dependency>In this method dependencies are handled semi-automatically, this means you will need a file that tells pip3 what are the dependencies and results in higher predictability as well as reduced human error.
pip3 install -e .Remember to replace <dependency> with the actual dependency of your code.
Virtual Environments avoid dependency mixing within the local system, this is useful when working on 1 or more projects. In this tutorial, Python3 VEnv will be the chosen tool. However, other tools like Cargo and Go Ecosystem can be use with the same purpose.
Have in mind that different tools means different steps to follow, even though the concept is the same.
To create a Python3 VEnv, you will need an empty directory to setup the VEnv inside it, in this case it will be called .venv.
The following command will create a Python3 VEnv in the previously mentioned directory:
python3 -m venv .venvYou can replace .venv with the directory of your preference, just remember that it has to be empty.