1

I would like to install all modules in a particular file for Python 3 using a single pip command. Is there a way to do this without having to specify every single package name?

  • You can explore how to use requirements.txt file to install all required packages for a project. – kiner_shah Aug 22 '22 at 09:13
  • I just complete the answer below with `pipreqs` to generate the `requirement.txt`: https://stackoverflow.com/a/31684470/15537469 – GuiEpi Aug 22 '22 at 13:25

3 Answers3

1

You then install it with pip install -r requirements.txt and it installs all the packages for your project.

Satyajit Barik
  • 145
  • 1
  • 1
  • 8
1

make a requirement file named requirements.txt in your project folder and then open a terminal (powershell , command prompt or whatever you prefer) and write the command

pip install -r requirements.txt

all the packages will be installed at once

Shreyansh Gupta
  • 382
  • 1
  • 10
1

Create a requirement.txt file and add all packages name inside that file then you can use pip install command like this:-

pip install -r requirement.txt

this will recursively install every package you mentioned in the requirement file.

If you want to generate requirement.txt from Django virtual environment you can use the pip freeze command:-

pip freeze > requirement.txt
Shiv
  • 81
  • 2
  • 3