Questions tagged [requirements.txt]

requirements.txt is the standard name for a requirements file for Python package installation program `pip`. It's used in the command like `pip install -r requirements.txt`.

requirements.txt is the standard name for a requirements file for Python package installation program pip. The file is list of items to be installed like so:

pip install -r requirements.txt

The items in the file can be package names (will be installed from Python Package Index or any other index configured in ~/.pypirc), package files or URLs to VCS.

For more information on requirements files see pip user guide.

635 questions
30
votes
3 answers

Installing Python Dependencies locally in project

I am coming from NodeJS and learning Python and was wondering how to properly install the packages in requirements.txt file locally in the project. For node, this is done by managing and installing the packages in package.json via npm install.…
henhen
  • 1,038
  • 3
  • 18
  • 36
29
votes
3 answers

Install local wheel file with requirements.txt

Have a local package ABC-0.0.2-py3-none-any.whl. I want to install it in the different project through requrements.txt. e.g. requirements.txt ABC==0.0.2 Flask==1.1.2 flask-restplus==0.13.0 gunicorn==20.0.4 Is it possible to install the ABC…
Rajan Sharma
  • 325
  • 1
  • 4
  • 11
29
votes
2 answers

Quiet output from pip via requirements file?

pip has a -q/--quiet flag that works ideally from the command line. I'm using an automated deployment process (Amazon Elastic Beanstalk), and the tools use pip to install from a requirements file. Unfortunately, pip is generating non-error output…
kungphu
  • 4,592
  • 3
  • 28
  • 37
28
votes
1 answer

What does `-e .` in requirements.txt do?

From: https://github.com/brandon-rhodes/luca/blob/master/requirements.txt ansi2html pytest sphinx tox -e . What does the last line, -e ., do?
user9905759
27
votes
3 answers

How to install from requirements.txt

I have to install python packages from requirements files that's provided to me. However, when I use pip install -r requirements.txt command I get an error saying ERROR: Invalid requirement (from line 3 in requirements.txt. And when I comment…
harry r
  • 786
  • 2
  • 6
  • 19
26
votes
1 answer

setup.py & pip: override one of the dependency's sub-dependency from requirements.txt

I'm currently working on a package and in my requirements.txt, I have a dependency: wikipedia. Now, wikipedia 1.3 uses requests-2.2.1 while my package uses version 2.3.0. Also, as one would expect, wikipedia-1.3's installation depends on presence of…
arcolife
  • 386
  • 1
  • 3
  • 12
24
votes
5 answers

Is requirements.txt still needed when using pyproject.toml?

Since mid 2022 it is now possible to get rid of setup.py, setup.cfg in favor of pyproject.toml. Editable installs work with recent versions of setuptools and pip and even the official packaging tutorial switched away from setup.py to…
Bastian Venthur
  • 12,515
  • 5
  • 44
  • 78
20
votes
5 answers

Building docs fails due to missing pandoc

The problem I am having trouble getting my docs to build successfully when clicking "Build" on the readthedocs.io web interface, but it builds just fine on my local machine. To test that it is an environment issue, I created a virtual…
keirasan
  • 365
  • 2
  • 6
19
votes
1 answer

Include .whl installation in requirements.txt

How do I include this in the requirements.txt file? For Linux: pip install http://download.pytorch.org/whl/cu75/torch-0.1.12.post2-cp27-none-linux_x86_64.whl pip install torchvision FOR MacOS: pip install…
Abhishek Bhatia
  • 9,404
  • 26
  • 87
  • 142
19
votes
1 answer

Check requirements for python 3 support

I have several python projects with different set of dependencies listed in pip requirements files. I've started to think about porting the code to python 3, but I need to know if my dependencies are already there. Is it possible to check what…
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
18
votes
2 answers

How to format requirements.txt when package source is from specific websites?

I am trying to convert the following installation commands using pip that downloads from another website, into a requirements.txt format, but just can't figure out how. Can anyone assist? pip install torch==1.5.0+cu101 torchvision==0.6.0+cu101 -f…
Jake
  • 2,482
  • 7
  • 27
  • 51
18
votes
4 answers

Managing contents of requirements.txt for a Python virtual environment

So I am creating a brand new Flask app from scratch. As all good developers do, my first step was to create a virtual environment. The first thing I install in the virtual environment is Flask==0.11.1. Flask installs its following…
Amistad
  • 7,100
  • 13
  • 48
  • 75
17
votes
3 answers

Creating requirements.txt in pip compatible format in a conda virtual environment

I have created a conda virtual environment on a Windows 10 PC to work on a project. To install the required packages and dependencies, I am using conda install instead of pip install as per the best practices mentioned in…
user14477880
17
votes
3 answers

How to cache requirements for a Django project on Travis-CI?

As Travis-CI is evolving and extending its feature set it naturally becomes nicer and nicer to use. I recently read this article about "Speeding up the build". A build for the Django project I am working on takes ~25-30 minutes. Almost half of this…
mamachanko
  • 886
  • 1
  • 7
  • 15
16
votes
8 answers

Robust way to ensure other people can run my python program

I wish to place a python program on GitHub and have other people download and run it on their computers with assorted operating systems. I am relatively new to python but have used it enough to have noticed that getting the assorted versions of all…
Mick
  • 8,284
  • 22
  • 81
  • 173
1 2
3
42 43