Agenda
Creating a virtual environment
Write a requirements list in a text file.
Install requirements specified in the requirements file.
Create a requirements text file from your installed modules (requirements.txt)
Sharing code and requirements in team.
1. Create a Virtual environment
From a Jupyter Notebook
From the commandline
python -m venv .venv
Activate it
Linux/Mac
source .venv/bin/activate
Windows
source .\.venv\Scripts\activate
requirements
# pip list
Package Version
---------- -------
pip 20.1.1
setuptools 46.4.0
wheel 0.34.2
pip install requests
# pip list
Package Version
---------- ---------
certifi 2020.6.20
chardet 3.0.4
idna 2.10
pip 20.1.1
requests 2.24.0
setuptools 46.4.0
urllib3 1.25.10
wheel 0.34.2
requirements.txt
certifi==2020.6.20
chardet==3.0.4
idna==2.10
requests==2.24.0
urllib3==1.25.10
Generate a requirements.txt from your installed packages
pip freeze > requirements.txt
Install the listed packages
pip install -r requirements.txt
.
├── .gitignore
├── Dockerfile
├── modules
│ ├── bar.py
│ ├── foo.py
│ └── util.py
├── requirements.txt
└── script.py
Ex 1: Clone and run
Clone this repository:
Read the readme file and follow the instructions
When you webapp is running you have done the job correct.