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
9
votes
2 answers

pip install via requirements.txt specify a direct GitHub private repo + branch name erroring with exit status 128

I am trying to add a package to my requirements.txt file that is: From a private GitHub repo I'm a member of the private repo I have ssh configured for the private repo From a branch besides master, whose name has a slash in it Using ssh…
Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119
9
votes
3 answers

How to compare requirement file and actually installed Python modules?

Given requirements.txt and a virtualenv environment, what is the best way to check from a script whether requirements are met and possibly provide details in case of mismatch? Pip changes it's internal API with major releases, so I seen advices not…
Roman Susi
  • 4,135
  • 2
  • 32
  • 47
9
votes
3 answers

Requiring only one of two dependencies in a requirements file

Some Python packages require one of two packages as a dependency. For example, Ghost.py requires either PySide or PyQt4. Is it possible to include such a dependency in a requirements.txt file? Is there any 'or' operator that works with these…
Or B
  • 1,675
  • 5
  • 20
  • 41
9
votes
2 answers

Is there any way to automatic detect required modules and packages in my own python project

I want to create a python distribution package, and need to check all the required packages for my own package. For requirements.txt, it include all the packages it needs. However, I want to find a way to check all the packages I need, and also,…
Kimmi
  • 591
  • 2
  • 7
  • 22
9
votes
2 answers

update a virtualenv to match requirements.txt

Currently, when our project's requirements.txt is updated, we re-build our virtualenv from scratch to ensure consistent results. The problem is that our requirements.txt is quite lengthy, and updates to it generally only touch a single package. Is…
bukzor
  • 37,539
  • 11
  • 77
  • 111
9
votes
2 answers

Should I include Sphinx and/or Nose in my module's requirements.txt?

I've created a Python module on Github that uses Nose for unit testing and Sphinx for generating documentation. I have two questions: Should I include Sphinx and/or Nose in my module's dependencies in setup.py (install_requires), as they are not…
goldsmith
  • 744
  • 6
  • 8
8
votes
4 answers

pip install requirement fails

I am facing an issue while trying to install the requirements for my django project. I am unable to figure out why I'm getting this error. Can someone lead me in the right direction? >Running setup.py egg_info for package django-staticfiles …
cclerv
  • 2,921
  • 8
  • 35
  • 43
8
votes
1 answer

Use >= or ~= for compatibilty across systems?

My goal is a simple and proper way to export my venv. In the optimal case, the resulting requirements.txt works on all compatible systems. At the moment I use pip freeze > requirements.txt. This uses the == "Version matching clause". On an other…
Paul Smith
  • 299
  • 2
  • 13
8
votes
1 answer

How to install local python packages when building jobs under Github Actions?

I am building a python project -- potion. I want to use Github actions to automate some linting & testing before merging a new branch to master. To do that, I am using a slight modification of a Github recommended python actions starter workflow --…
PallavBakshi
  • 522
  • 2
  • 12
  • 21
8
votes
3 answers

Is there a way to programmatically confirm that a python package version satisfies a requirements specifier?

I am trying to find whether there is a way to take an installed package and version and check whether it satisfies a requirements spec. For example, if I have the package pip==20.0.2, I want the program to do the…
8
votes
3 answers

cairocffi install failed on Ubuntu 18.04

I am running pip freeze on a python project, it shows string VERSION other than numberical version and it fails the package installation, the warning message is: weasyprint 43 has requirement cairocffi>=0.9.0, but you'll have cairocffi…
Haifeng Zhang
  • 30,077
  • 19
  • 81
  • 125
8
votes
1 answer

Are there naming conventions for pip requirements files?

Are there conventions for storing multiple requirements.txt files in a Python code repository. For example, one file for simply running the program, another for day-to-day development, another for making a Windows build. Some repositories contain…
lofidevops
  • 15,528
  • 14
  • 79
  • 119
7
votes
1 answer

How to omit dependency when exporting requirements.txt using Poetry

I have a Python3 Poetry project with a pyproject.toml file specifying the dependencies: [tool.poetry.dependencies] python = "^3.10" nltk = "^3.7" numpy = "^1.23.4" scipy = "^1.9.3" scikit-learn = "^1.1.3" joblib =…
Rulle
  • 4,496
  • 1
  • 15
  • 21
7
votes
1 answer

Why is setuptools not available in environment Ubuntu docker image with Python & dev tools installed?

I'm trying to build a Ubuntu 18.04 Docker image running Python 3.7 for a machine learning project. When installing specific Python packages with pip from requirements.txt, I get the following error: Collecting sklearn==0.0 Downloading…
Des Grieux
  • 520
  • 1
  • 5
  • 31
7
votes
1 answer

Add requirements from requirements.txt to conda meta.yaml

I'm writing a Python package that I want to publish on both pypi and conda. To avoid mistakes, I would like to store the requirements in a single file; at least for the foreseeable future, they are the same. It is easy to go from meta.yaml to…
Dimebag
  • 833
  • 2
  • 9
  • 29