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
14
votes
1 answer

Caching pipenv / Pipfile dependencies on TravisCI

The Travis documentation on caching does not specifically mention how to cache python dependencies installed from pipenv's Pipfile, rather than from pip's usual requirements.txt. I tried setting up pip caching per documentation anyway, but build…
shacker
  • 14,712
  • 8
  • 89
  • 89
14
votes
3 answers

Add pip requirements to docker image in runtime

I want to be able to add some extra requirements to an own create docker image. My strategy is build the image from a dockerfile with a CMD command that will execute a "pip install -r" command using a mounted volume in runtime. This is my…
ralvarez
  • 421
  • 2
  • 5
  • 13
14
votes
3 answers

Python Django requirements.txt

I have a requirements.txt file containing all my dependencies but it is not processed correctly : After a pip install -r requirements.txt, I get the following pip freeze : argparse==1.2.1 wsgiref==0.1.2 But when I do a pip install of…
Mibou
  • 936
  • 2
  • 13
  • 25
13
votes
2 answers

In Jenkins: pip install from git repo using SSH keys

In my Jenkins job, during the build phase, I execute pip install -r requirements.txt. Among my project's requirements, there are some paths to private git repositories, needing SSH keys to authenticate. I already created the keys (no passphrase),…
Eran Zimmerman Gonen
  • 4,375
  • 1
  • 19
  • 31
13
votes
2 answers

Docker-compose does not reflect changes in requirements.txt

Changes in my requirements.txt are not being reflected when I run: docker-compose -f docker-compose-dev.yml up -d docker-compose-dev.yml version: '3.6' services: web: build: context: ./services/web dockerfile: Dockerfile-dev …
8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198
13
votes
3 answers

Add module from RPM as a requirement

So I have this project with many dependencies that are being installed from pip and are documented in requirements.txt I need to add another dependency now that doesn't exist on pip and I have it as an RPM in some address. What is the most Pythonic…
Pavel Zagalsky
  • 1,620
  • 7
  • 22
  • 52
13
votes
2 answers

pip requirement.txt conditionals or environment markers based on env variables

Is there a way to specify conditional installs in a pip requirements.txt file that are based on the value of an environment variable? I've been able to control most of what I need with environment markers, but all the markers I know of work only…
ghoff
  • 301
  • 1
  • 3
  • 10
12
votes
2 answers

CPAN Requirements File

With pip you are able to create a requirements file to specify which libraries to install. Is there an equivalent for perl modules using CPAN? I came across ExtUtils::MakeMaker, but this seems like the make file is for each module specifically. I…
DoolAy
  • 247
  • 3
  • 9
10
votes
1 answer

No module named pipreqs.__main__; 'pipreqs' is a package and cannot be directly executed

I am trying to use pipreqs module to generate requirements text. But pipreqs is generating following error. No module named pipreqs.__main__; 'pipreqs' is a package and cannot be directly executed I'm using Visual Studio Code, and trying to use…
carl
  • 603
  • 5
  • 17
10
votes
2 answers

PyCharm treats all txt files like requirements file

I have requirements.txt file in my project and PyCharm works perfectly fine with it. However, it also checks every other txt file and displays misleading error messages. For example, having foo.txt file with a string bar baz written in it produces…
sanyassh
  • 8,100
  • 13
  • 36
  • 70
10
votes
1 answer

Pip Requirements.txt --global-option causing installation errors with other packages. "option not recognized"

I'm having difficulties with the --global-option and --install-option settings for a requirements.txt file. Specifying the options for one library is causing other libraries installs to fail. I'm trying to install Python libraries "grab" and…
Shane
  • 115
  • 1
  • 9
10
votes
1 answer

Format a requirements.txt file for pip where one or more packages have a different index-url

I am trying to deploy a Django app to Heroku where one of the required packages lives on https://testpypi.python.org/pypi and of course Django is on the main PyPI server. The requirements.txt file looks like so: Django==1.7.7 -i…
robbmj
  • 16,085
  • 8
  • 38
  • 63
10
votes
2 answers

Pip install from a specific commit prompts "requirements already satisfied"

I'm using pip and a requirements.txt file to handle my python packages in my virtualenv. I have a particular package I install from Github so that inside my file I have: git+ssh://git@github.com/myuser/mypackage.git#egg=mypackage Since I'm working…
Leonardo
  • 4,046
  • 5
  • 44
  • 85
9
votes
4 answers

pip installing environment.yml as if it's a requirements.txt

I have an environment.yml file, but don't want to use Conda: name: foo channels: - defaults dependencies: - matplotlib=2.2.2 Is it possible to have pip install the dependencies inside an environment.yml file as if it's a requirements.txt…
Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119
9
votes
2 answers

How to update a requirements file automatically when new packages are installed?

Keeping track of a virtual environment's requirements via pip freeze is simple. pip freeze > requirements.txt Currently, however, whenever a new package is added to the venv, it needs to be added to the requirements file manually. To do so, I…
AnagramDatagram
  • 329
  • 1
  • 2
  • 14