Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

How to install Python packages with requirements.txt

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Python package is a container for to store multiple python modules. We can install packages in python using pip package manager. In this article we will learn to install multiple packages at once using the requirements.txt file. The requirements.txt file is useful to install all packages at once for a project, it is easy to handover to other developers and we can use this to install different versions of packages for different python projects.

The classic way of installing packages in python using pip:

pip install package_name1, package_name2

Installing python packages using requirements.txt file:

We will define each package in a new line in the requirements.txt file.

Let’s say below three python packages we defined in the requirements.txt file.

  • pandas
  • pillow
  • numpy

 

We will install packages using the below command. Run the below command where the requirements.txt file is present.

pip install -r requirements.txt

PIP will download and install all packages present in that file.

 

My Personal Notes arrow_drop_up
Last Updated : 07 Nov, 2022
Like Article
Save Article
Similar Reads
Related Tutorials