Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D Desastres
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Desastres
  • Desastres
  • Wiki
  • setting enviroment

Last edited by Gabriel Henrique Paul Nov 16, 2018
Page history
This is an old version of this page. You can view the most recent version or browse the history.

setting enviroment

|Home|Quick Start|Sprints|Requirements|Architecture|Server Config|API|GIT|Simulation|Agents| |:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|

Configuring the virtual enviroment

Pre steps

Our project relies on a Virtual Environment (venv) in order for it to work. So, what is a venv? Long story short it is a place in a python project where we can add all the libraries we want and it only affects the enclosing project. To use it we need VirtualEnvironment installed in our computer, but gladly for us our project runs with python 3.6 who already supports it, yay! 🤓. To set up the virtual environment of this project the python interpreter must be at version 3.6 (or later). The download can be found on Python Interpreter.

To set up the python interpreter on your machine see Python SetUp

After the Python interpreter is correctly installed on your machine, you must open the terminal and or the prompt to set up the virtual environment. Verify if you have the 'pip' installed typing on the terminal

pip --version

If installed, the current version of pip was shown and you can proceed with the enviroment configuration, if not you can download and install pip through this link Pip Installation


Setting up a virtual environment

Setting up a venv is a lot straightforward, all we need to do is run a few commands at a terminal console.

We need to go to the project folder.

cd <PROJECT DIRECTORY>

Then we create a folder named "venv".

mkdir venv

Now we setup a virtual environment with this command.

python3 -m venv venv

And activate it.

source venv/bin/activate (After running this command you will see in the terminal that at the start of the line is a (venv), this mean that all you run from now will be applied only into this virtual environment)

Installing virtual environment

With all the pre steps finished, you can continue with the installation of the virtual environment.

On the terminal type

pip3 install pipenv

  • The command will install the pipenv library to manage the virtual environments on your machine.



Going to the project folder you must type:

pipenv install

  • It will install all the required dependencies in the project using as parameter the Pipfile in the root of the project directory.

PyCharm

If the virtual environment was not already set by the IDE, you must configure it to run the project.

  1. Opening the IDE you can use the shortcut ctrl + alt + s to open the project settings
  2. Once popped up on the screen, open the Project: Desastres tab
  3. Select Project Interpreter
  4. On the right side of the path to the current virtual environment or the '' field, click on the engine and Add...
  5. Select the Existing environment radio button
  6. On the right side of "" or the old path of the environment, select the ... button and chose the path to the interpreter

Tip: The interpreter probably is inside the .virtualenvs folder created on your user profile

Clone repository
  • API
  • QuickStart
  • agents
  • agents
    • actions
    • agent
  • api
    • firstconnection
    • firstmessage
    • how it works
    • stepsmessages
  • Home
  • notes
  • requirements
  • setting enviroment
  • simulation
  • simulation
    • corearchitecture
View All Pages