|
|
|
# Configuring the virtual enviroment
|
|
|
|
|
|
|
|
## Pre steps
|
|
|
|
|
|
|
|
To set up the virtual enviroment of the projet its needed a base python interpreter (must be python 3.6). The download can be found on [Python Interpreter](https://www.python.org/downloads/release/python-367/).
|
|
|
|
To set up the python interpreter on your machine see [Python SetUp](https://docs.python.org/3/using/windows.html)
|
|
|
|
<br><br>
|
|
|
|
After the Python interpreter is correctly installed on your machine, you must open the terminal and or the prompt to set up the virtual enviroment.
|
|
|
|
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 throught this link [Pip Installation](https://pip.pypa.io/en/stable/installing/)
|
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
## Installing virtual enviroment
|
|
|
|
|
|
|
|
With all the pre steps finished, you can continue with the installation of the virtual enviroment
|
|
|
|
<br><br>
|
|
|
|
On the terminal type
|
|
|
|
> pip install pipenv
|
|
|
|
|
|
|
|
* The command will install the pipenv library to manage the virtual enviroments on your machine
|
|
|
|
|
|
|
|
<br><br>
|
|
|
|
Going to the project folder you must type
|
|
|
|
> pipenv install
|
|
|
|
|
|
|
|
* It will install all the required dependencies in the project
|
|
|
|
|
|
|
|
***
|
|
|
|
|
|
|
|
## PyCharm
|
|
|
|
|
|
|
|
If the virtual enviroment 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 left side of the path to the current virtual enviroment or the '<No interpreter>' field, click on the engine and `Add...`
|
|
|
|
5. Select the `Existing enviroment` radio button
|
|
|
|
6. On the left side of "<No interpreter>" or the old path of the enviroment, select the `...` button and chose the path to the interpreter
|
|
|
|
|
|
|
|
Tip: The interpreter probably is inside the `.virtualenvs` folder created on your user profile |