Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 804 Bytes

install-python-packages-with-a-requirements-file.md

File metadata and controls

31 lines (21 loc) · 804 Bytes

Install Python Packages With A Requirements File

Category: Python

Multiple packages for a Python project can be installed using a requirements.txt file as an alternative to using the pip install command. This approach should be used to effectively manage dependencies for a project.

For example, add package dependencies to requirements.txt as follows:

flask-restful >= 0.3.8
torch >=2.0.0
transformers >= 4.27.4

Run the following command to install the packages using requirements.txt:

pip install -r requirements.txt

Note: If you encounter the following error on macOS:

-bash: [...] bad interpreter: No such file or directory

Install the packages using requirements.txt as follows:

python3 -m pip install -r requirements.txt