pip is the standard, de-facto package installer for Python. Created to be a better alternative to easy_install. In fact, pip enables you to install and manage additional packages, usually from PyPI that are not part of the standard Python library.
This short article is going to show you how to install multiple packages in one line using pip
.
Install multiple packages from command line
pip is made to manage the installation of third-party packages, one of the functionality is installing packages via pip install package_name
command.
In order to installing multiple packages all at once with pip, you can simply pass a list of all the packages you want to install, separated by spaces. For example:
pip install ipython requests pylint autopep8
The command above installs all the dependencies along with the packages as well, so you don’t have to worry about broken installation.
pip: Install multiple packages from requirements.txt
If you have a file that contains a list of all packages you need (usually named requirements.txt
), you can use the following commands to quickly download and install all of them.
pip install -r requirements.txt
The file doesn’t have to be named requirements.txt
for the command to work, though.
If your machine crashes during the importing process, you may try to pass --no-cache-dir
switch to disable caching in pip
.
pip install --no-cache-dir -r requirements.txt
We hope that the information above is helpful to you. You may want to check out our other guides on solving “pip: command not found” error and how to use pipenv in VSCode.