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
6
votes
0 answers

Direct link in pip requirements file

How can I add the pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html to a requirements.txt? I tried setting the version to the link as well as just adding the link and both are apparently incorrect Edit:…
Austin
  • 6,921
  • 12
  • 73
  • 138
6
votes
2 answers

Django | update requirements.txt automatically after installing new package

I am new to Django. Every time I install new library using pip, I have to run pip freeze -l > requirements.txt and sometimes I forget this ( and error happens at my production environment). What's the best way to run this command automatically when…
kansiho
  • 532
  • 4
  • 18
6
votes
0 answers

pip freeze sets subdirectories

I have a repository, myBigRep, that contains a submodule, mySmallRep. This submodule is a python project that has a setup.py script that installs some commands. To set it, I run: $ pip install --editable myBigRep/local/src/mySmallRep/ And that's…
kaligne
  • 3,098
  • 9
  • 34
  • 60
5
votes
1 answer

I get "ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==" when I do "pip install -r requirements"

I get following message at the bottom of cmd line when I try to install some requirements with python 3.6.8 to my folder using "pip install -r requirements.txt" ERROR: In --require-hashes mode, all requirements must have their versions pinned with…
WenChun
  • 51
  • 1
  • 2
5
votes
1 answer

How to include a release candidate (rc) OR the actual version once released in `requirements.txt`

I want to set a dependency in my requirements.txt for tensorflow~=2.5.0. At the time of writing, tensorflow==2.5.0 hasn't been released yet. The latest version available is the release candidate tensorflow==2.5.0rc3. How can I succinctly tell pip to…
swimmer
  • 1,971
  • 2
  • 17
  • 28
5
votes
3 answers

Python 'requirements.txt' file in package

SITUATION: I have created a python package where I use the following libraries: matplotlib regex statistics os unittest coverage my problem is that when I do pip freeze, the result only returns versions values…
idriskameni
  • 173
  • 1
  • 1
  • 6
5
votes
4 answers

No matching distribution found for pprint

I am trying to install the requirements.txt file for skiptracer and it keeps saying ERROR: Could not find a version that satisfies the requirement pprint (from -r requirements.txt (line 7)) (from versions: none) ERROR: No matching distribution found…
user14216134
  • 61
  • 1
  • 3
5
votes
1 answer

Create requirements.txt without @ ~~ things

I want to create requirements.txt using pip freeze > requirements.txt command and copied to Google Drive to use in Google Colab but there is an error like: ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or…
Hyunseo Lee
  • 143
  • 2
  • 9
5
votes
1 answer

requirements.txt vs Pipfile in heroku flask webapp deployment?

I'm trying to deploy a Flask webapp to Heroku and I have seen conflicting information as to which files I need to include in the git repository. My webapp is built within a virtual environment (venv), so I have a Pipfile and a Pipfile.lock. Do I…
rmd_po
  • 381
  • 1
  • 4
  • 12
5
votes
1 answer

How to avoid installing requirements.txt before every stage in .gitlab-ci.yml?

I have a .gitlab-ci.yml which looks like this: image: "python:3.7" before_script: - pip install -r requirements.txt stages: - stageA - stageB stage_a: stage: stageA script: - run_some_python_scripts stage_b: stage: stageB …
5
votes
1 answer

How can I optimize my requirements.txt to include only the packages my application uses directly?

Say for example I add django to my venv with pip install django. The usual way to generate my requirements.txt file is with pip freeze > requirements.txt which produces: asgiref==3.2.3 Django==3.0.2 pytz==2019.3 sqlparse==0.3.0 This is a lie. My…
Paul Whipp
  • 16,028
  • 4
  • 42
  • 54
5
votes
1 answer

pip install editable working dir to custom path using requirements.txt

Short version: Is it possible to use the -e parameter in requirements.txt with a path where the editable package should be installed? First approach requirements.txt: -e git+https://github.com/snake-soft/imap-storage.git#egg=imap-storage Pro:…
Frank
  • 1,959
  • 12
  • 27
5
votes
2 answers

Install R packages from requirements.txt file

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…
5
votes
1 answer

pip install producing "Could not find a version that satisfies the requirement"

I have a package that i have uploaded to test.pypi. I can install this package in a virtual environment on my machine without any issues using pip install --index-url https://test.pypi.org/simple/ package_name_here There is a list of requirements…
abinitio
  • 609
  • 6
  • 20
5
votes
1 answer

Best practice to install package dependency not available in pypi

My python package depends on a private package that is not in pypi. You can assume that the structure of the private package is this. Goal: store the 3rd party private package somewhere within my own package in a whatever way such that when I run…
MLguy
  • 1,776
  • 3
  • 15
  • 28