The xFusionCorp Industries data science team needs a standardised Python environment for their new ML project. Set up a virtual environment with the required ML libraries on the controlplane host.
Create a Python virtual environment named ml-env under /root/code/ using python3 -m venv.
Activate the environment and install the following packages: numpy, pandas, scikit-learn, and matplotlib.
Generate a requirements.txt file using pip freeze and save it at /root/code/requirements.txt.
Create virtual environment in ml-env.
python3 -m venv ml-env
Activate enviornment, then install ML packages.
source ml-env/bin/activate
pip install numpy pandas scikit-learn matplotlib
Freeze installed packages into requirements.txt
pip freeze > requirements.txt
To test run the following command
pip install -r requirements.txt
It will ensure that you already installed thoose packages