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

Pipreqs generate incorrect requiremnets for Hydra

I'm using pipreqs for generating requirements.txt. I started using hydra package (see https://hydra.cc/ or hydra-core package on PyPI). So I would like pipreqs to add hydra-core dependency automatically when I run. But, when I checked output of…
Nerxis
  • 3,452
  • 2
  • 23
  • 39
2
votes
1 answer

Dockerfile: pip install fails with requirements.txt (but succeeds with individual packages)

I'm trying to install some packages in a docker container, and there is a problem when installing from a requirements.txt file. This line: RUN python3.8 -m pip install -r requirements.txt fails with the error: ... Collecting torch Downloading…
giladrv
  • 1,024
  • 1
  • 9
  • 22
2
votes
0 answers

How to reference private bitbucket packages in requirements.txt when containerizing with Docker?

I'm working on some private python packages (johnathan_prices, johnathan_predict) and have them all installed to the same site-packages folder so they can call each other easily. I install them in editable mode (pip install . -e) so that debugging…
user1367204
  • 4,549
  • 10
  • 49
  • 78
2
votes
1 answer

An unclear requirements.txt error which results in not being able to install

From today, I started getting error while installing modules from requirements.txt, I tried to find the error module and remove it but I couldn't…
2
votes
2 answers

how to print time took for each package in requirement.txt to be installed

Is there any convenient way to print the time took for each package when running pip install -r requirements.txt? I would like something like pip install -r requirement.txt --print-times and instead of just printing the names of the package and the…
Tomer Cohen
  • 222
  • 1
  • 6
2
votes
0 answers

Setup.py and Docker layering for building python applications

tl;dr How do I use dockers layering technique without a requirements.txt for python3? Long story: A well formed Dockerfile for python should look as follows: FROM python COPY requirements.txt requirements.txt RUN pip install -r requirements.txt COPY…
pag
  • 21
  • 3
2
votes
1 answer

How to satisfy this dependency requirements?

pathlib==1.0.1; python_version < "3.4" I am installing a requirements.txt by: pip install requirements.txt This is a third party software. I am seeing one line was like above in the requirements.txt. Does it mean it must have Python version < 3.4?…
marlon
  • 6,029
  • 8
  • 42
  • 76
2
votes
1 answer

Reducing requirements.txt

Is there a way to reduce my requirements.txt I switched to Python a year ago and back then I did not completely understand how things work. So when I needed to create requirements.txt I just did a pip freeze and copy passed all the requirements.…
urag
  • 1,228
  • 9
  • 28
2
votes
0 answers

pip install doesn't work when requirements.txt has an editable dependency from git

I have the following Pipfile with a single dependency from git: [packages] requests = {editable = true, git = "https://github.com/requests/requests.git",ref = "v2.20.1"} Then I run: pipenv install pipenv run pip freeze >requirements.txt Which…
cahen
  • 15,807
  • 13
  • 47
  • 78
2
votes
1 answer

pip installl - skip specific dependencies

How can pip skip only one dependency while install all the others. Using --no-deps, --no-dependencies as answered on this topic would not work since it prevents all depencencies. The reason I need to skip a single dependency is due to the fact this…
Rafael Borja
  • 4,487
  • 7
  • 29
  • 33
2
votes
2 answers

Regex to detect and replace lines with duplicated capturing groups to remove duplicated packages in pip requirements.txt file

A python requirements.txt file is invalid if it has different versions for the same package, represented as the lines bellow (the file is assumed to be sorted): agate==1.6.0 agate==1.7.0 I'm trying to write a regex to detect duplicated packages…
Rafael Borja
  • 4,487
  • 7
  • 29
  • 33
2
votes
0 answers

Python requirements.txt aliases to quiet IDE

Some requirements have different pip names than they do when you import them. For example, Discord.py is installed by using pip install discord.py, but when you use it in code, it's just import discord. Therefore PyCharm complains that "package not…
cclloyd
  • 8,171
  • 16
  • 57
  • 104
2
votes
1 answer

Is it possible to pip-compile a requirements.txt with the oldest dependencies?

I use pip-compile from pip-tools to create a requirements.txt which has all dependencies (including all transitive ones) which fulfill all requirements and are consistent. This is nice for applications which I run via CI/CD. For libraries, I think…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
2
votes
1 answer

Unable to deploy Django app in Heroku due to requirements.txt error

I am trying to deploy a django app I created to heroku. When i do git push heroku master an error shows remote: cp: cannot create regular file '/app/tmp/cache/.heroku/requirements.txt': No such file or directory. here is the full log: Enumerating…
iscream
  • 680
  • 2
  • 8
  • 20
2
votes
0 answers

Elastic Beanstalk Python requirements.txt install from local .whl file

I have a simple Elastic Beanstalk Python instance that is installing flask using a requirements.txt file that looks like this Flask==1.0.2 This works, but in the interests of speed I am trying to instead use a predownloaded wheel .whl file to…