Installing Django Requirements.txt into a venv virtual environment

D
1 min readJul 19, 2022
Photo by Faisal on Unsplash

It is typically thought of as best practice to use virtual environments to encapsulate python modules. This is to prevent the dependencies of one project from interfering with that of another.

In order to install the python modules of a django project into a venv environment, follow these steps:

Step 1: Downloading venv

Go ahead and install the venv program using sudo apt install python3-venv

Step 2: Make a directory and initialise it as a virtual environment

Create a directory using: mkdir djangoenv and create and initialise a virtual environment using: python3 -m venv djangoenv

Step 3: Activate the virtual environment

Use the command: source djangoenv/bin/activate

Step 4: Download all the django dependencies into the venv

Use the following command to download all the python modules from the requirements.txt using the pip package manager and placing those modules into a venv away from the global set-up

pip install -r requirements.txt

--

--

D
D

Written by D

An aspiring Robotics Researcher. I am currently in my 4th year of undergraduate studies. I am working on optimising the ROS navigation packages. Follow 4 more!

No responses yet