... | @@ -3,8 +3,7 @@ |
... | @@ -3,8 +3,7 @@ |
|
|
|
|
|
- List tools for managing Python environments
|
|
- List tools for managing Python environments
|
|
- Declare dependencies
|
|
- Declare dependencies
|
|
- Use `venv` to install dependencies
|
|
- Using `pipenv` to install dependencies
|
|
- Use `virtualenv` to install dependencies
|
|
|
|
|
|
|
|
>>>
|
|
>>>
|
|
|
|
|
... | @@ -88,7 +87,7 @@ requests [security] >= 2.8.1, == 2.8.* ; python_version < "2.7" |
... | @@ -88,7 +87,7 @@ requests [security] >= 2.8.1, == 2.8.* ; python_version < "2.7" |
|
|
|
|
|
### :tools: Exercise
|
|
### :tools: Exercise
|
|
|
|
|
|
Create your `requirements.txt`and start your `pipenv`environment:
|
|
Create your `requirements.txt` and start your `pipenv`environment:
|
|
```bash
|
|
```bash
|
|
nano requirements.txt
|
|
nano requirements.txt
|
|
pipenv install -r requirements.txt
|
|
pipenv install -r requirements.txt
|
... | @@ -96,9 +95,9 @@ pipenv install -r requirements.txt |
... | @@ -96,9 +95,9 @@ pipenv install -r requirements.txt |
|
|
|
|
|
Look at `Pipfile`and `Pifile.lock`.
|
|
Look at `Pipfile`and `Pifile.lock`.
|
|
|
|
|
|
To reset your environment: `pipenv --rm`, it doesn't detsroy the `Pipfile(.lock)`, so you can recreate the environment with: `pip install`.
|
|
To reset your environment: `pipenv --rm`, it doesn't destroy the `Pipfile(.lock)`, so you can recreate the environment with: `pip install`.
|
|
|
|
|
|
To check in which folder are the dependances placed: `pipenv --venv`.
|
|
To check in which folder are the dependencies placed: `pipenv --venv`.
|
|
|
|
|
|
### `environment.yml` example
|
|
### `environment.yml` example
|
|
|
|
|
... | @@ -211,7 +210,7 @@ And with some other environment management tools: |
... | @@ -211,7 +210,7 @@ And with some other environment management tools: |
|
>>>
|
|
>>>
|
|
**:tools: Exercise**
|
|
**:tools: Exercise**
|
|
|
|
|
|
Install the dependencies for this workshop using `pipenv`.
|
|
Install the dependencies for this tutorial using `pipenv`.
|
|
|
|
|
|
The `requirements.txt` file is located in the `practical_session/configuration` directory.
|
|
The `requirements.txt` file is located in the `practical_session/configuration` directory.
|
|
|
|
|
... | @@ -222,6 +221,7 @@ pipenv --rm |
... | @@ -222,6 +221,7 @@ pipenv --rm |
|
rm Pipfile*
|
|
rm Pipfile*
|
|
cp practical_session/configuration/requirements.txt requirements.txt
|
|
cp practical_session/configuration/requirements.txt requirements.txt
|
|
pipenv install -r requirements.txt
|
|
pipenv install -r requirements.txt
|
|
|
|
```
|
|
>>>
|
|
>>>
|
|
|
|
|
|
## Deactivate the active environment
|
|
## Deactivate the active environment
|
... | @@ -230,4 +230,4 @@ To deactivate it you need to run `deactivate` in your terminal: |
... | @@ -230,4 +230,4 @@ To deactivate it you need to run `deactivate` in your terminal: |
|
|
|
|
|
```bash
|
|
```bash
|
|
deactivate
|
|
deactivate
|
|
`````` |
|
``` |