You must install the dependencies using Pip (python index Packages).
In general (this is a convention) the dependencies are listed in a file, with the name:
requirements.txt
Which also by convention is located at raiz do projeto
.
This way when downloading a project to install the dependencies just run the command:
pip install requirements.txt
These conventions are not part of any specific EP, but are documented in the python backpacker guide
Running the above command, the dependencies will be installed, so you can start the application.
Good practices related to the creation of a new environment
When cloning the project the ideal is to use the virtualenv
to create a new clean environment (without external dependencies) and from this environment proceed to the installation of dependencies.
Create the virtualenv
To create the virtual environment I use the virtualenv program. Running the following command:
virtualenv venv -p $(which python3)
This command will create a directory name venv
(can choose the name) in the folder where it was executed, in this case the directory where I am (cwd) using python3 binaries.
Note: from the version of python3.3, a mechanism for creating virtual environments incorporated into Python3 was included. If this is the case you don’t need to have virtualenv installed and to create the virtual environment, just run the comando
:
python3 -m venv </caminho/para/novo/ambiente/virtual>
More information can be found on PEP 405
Activating the virtualenv
To activate the virtual environment, using the terminal (bash, sh), we must execute the command:
source venv/bin/activate #para linux
#para Windows é necessário executar scripts/activate.bat
After activating the virtual environment we can proceed to the installation of the dependencies.
In Linux-based environments an indicator that the virtual environment is active is that in the shell runline the name of the environment appears in parentheses.
As in the example:
(venv) user@ubuntu:~$ #<-- virtualenv ativo
user@ubuntu:~$ #<-- virtualenv não está ativo, isso é o shell padrão.
Setting up the offices
After activating virtualenv now just install the dependencies, with the command:
pip install -r requirements.txt
Summary
clone the project:
git clone <endereço do projeto em algum repositório>
Enter the cloned project folder
Creating the virtual environment:
virtualenv venv -p $(which python3)
activate the virtual environment:
source venv bin/activate
install the dependencies:
pip install -r requirements.txt
Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.
–