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
81
votes
10 answers

How to specify install order for python pip?

I'm working with fabric(0.9.4)+pip(0.8.2) and I need to install some python modules for multiple servers. All servers have old version of setuptools (0.6c8) which needs to be upgraded for pymongo module. Pymongo requires setuptools>=0.6c9. My…
Seppo Erviälä
  • 7,160
  • 7
  • 35
  • 40
77
votes
4 answers

Check if requirements are up to date

I'm using pip requirements files for keeping my dependency list. I also try to follow best practices for managing dependencies and provide precise package versions inside the requirements file. For example: Django==1.5.1 lxml==3.0 The question is:…
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
74
votes
1 answer

What does pip-compile do? What is its use? (how do I maintain the contents of my requirements.txt file?)

I am a beginner in programming and Python. I read pip-compiles definition in pip-tools documentation but I could not understand. Can someone explain me this? More specifically, what does compiling requirements.in to produce requirements.txt mean?
nilinswap
  • 1,226
  • 1
  • 10
  • 17
73
votes
1 answer

Requirements.txt greater than equal to and then less than?

I have this line in my requirements file django>=1.10,<1.11 Does that mean I need to have Django version >= 1.10 and then less than 1.11?
Chris
  • 4,643
  • 6
  • 31
  • 49
72
votes
5 answers

tell pip to install the dependencies of packages listed in a requirement file

Developing a Django web app, I have a list of packages I need to install in a virtualenv. …
Maxime R.
  • 9,621
  • 7
  • 53
  • 59
71
votes
4 answers

pip freeze without dependencies of installed packages

When I do pip freeze I get the packages I've explicitly installed plus those packages that are dependencies of those packages. For example: $ pip install fabric ... $ pip freeze Fabric==1.0.1 paramiko==1.7.6 pycrypto==2.3 Ok fine but then I move to…
Tom Viner
  • 6,655
  • 7
  • 39
  • 40
59
votes
5 answers

What does " -r " do in pip install -r requirements.txt

I looked up how to install multiple packages from a requirements document using pip. The answers were mostly: pip install -r requirements.txt What does the -r do though? I can't find an answer for this and it isn't listed when I run pip help.
SuperCow
  • 1,523
  • 7
  • 20
  • 32
51
votes
3 answers

How to create a requirements.txt?

I'm wondering how I can create a suitable requirements.txt for my Python 3 application?
Daniel Santos
  • 881
  • 2
  • 9
  • 17
49
votes
1 answer

Is there something like requirements.txt for R?

Is there a functionality like requirements.txt in Python, where you can store a list of packages used into a file, and whenever other people want to run your programs and need to install the dependencies, they can just do pip install -r…
hans-t
  • 3,093
  • 8
  • 33
  • 39
47
votes
9 answers

Check if my Python has all required packages

I have a requirements.txt file with a list of packages that are required for my virtual environment. Is it possible to find out whether all the packages mentioned in the file are present. If some packages are missing, how to find out which are the…
Alagappan Ramu
  • 2,270
  • 7
  • 27
  • 37
36
votes
2 answers

Equivalent of `package.json' and `package-lock.json` for `pip`

Package managers for JavaScript like npm and yarn use a package.json to specify 'top-level' dependencies, and create a lock-file to keep track of the specific versions of all packages (i.e. top-level and sub-level dependencies) that are installed as…
djvg
  • 11,722
  • 5
  • 72
  • 103
33
votes
5 answers

Install PyTorch from requirements.txt

Torch documentation says use pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html to install the latest version of PyTorch. This works when I do it manually but when I add it to req.txt and do…
Siddharth Prajosh
  • 1,013
  • 2
  • 9
  • 16
33
votes
2 answers

Travis special requirements for each python version

I need unittest2 and importlib for python 2.6 that is not required for other python versions that travis tests against. Is there a way to tell Travis-CI to have different requirements.txt files for each python version?
fakedrake
  • 6,528
  • 8
  • 41
  • 64
32
votes
1 answer

How to install python module extras with pip requirements.txt file

The pip requirements.txt documentation says that extras may be installed using a line like MyPackage==3.0 [PDF] So in my requirements.txt file I have a line that reads: requests==2.9.1 [security] but instead of installing the security extras for…
Michael Lang
  • 2,157
  • 3
  • 22
  • 29
30
votes
2 answers

pip's requirements.txt best practice

I am trying to generate requirements.txt for someone to replicate my environment. As you may know, the standard way is pip freeze > requirements.txt I noticed that this will list all the packages, including the dependencies of installed packages,…
Darren Christopher
  • 3,893
  • 4
  • 20
  • 37
1
2
3
42 43