Questions tagged [install-requires]

“install_requires” should be used to specify what dependencies a project minimally needs to run. When the project is installed by pip, this is the specification that is used to install its dependencies.

Source: https://packaging.python.org/tutorials/distributing-packages/#install-requires

22 questions
68
votes
4 answers

Install dependencies from setup.py

I wonder if as well as .deb packages for example, it is possible in my setup.py I configure the dependencies for my package, and run: $ sudo python setup.py install They are installed automatically. Already researched the internet but all I found…
adinanp
  • 935
  • 3
  • 8
  • 11
59
votes
2 answers

install_requires based on python version

I have a module that works both on python 2 and python 3. In Python<3.2 I would like to install a specific package as a dependency. For Python>=3.2. Something like: install_requires=[ "threadpool >= 1.2.7 if python_version < 3.2.0", ], How…
iTayb
  • 12,373
  • 24
  • 81
  • 135
25
votes
3 answers

python setuptools install_requires is ignored when overriding cmdclass

I have a setup.py that looks like this: from setuptools import setup from subprocess import call from setuptools.command.install import install class MyInstall(install): def run(self): call(["pip install -r requirements.txt…
zseder
  • 1,099
  • 2
  • 12
  • 15
8
votes
1 answer

Call another setup.py in setup.py

My repository contains my own python module and a submodule to one of its dependencies which has its own setup.py. I'd like to call the dependency's setupy.py when installing my own lib, how is it possible? My first attempt: $ tree . ├──…
myoan
  • 401
  • 5
  • 14
6
votes
1 answer

Installing PyTorch with CUDA in setup.py

I'm trying to specify PyTorch with CUDA in install_requires. The command to install with pip is pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio===0.8.0 -f https://download.pytorch.org/whl/torch_stable.html How do I do that in the…
user3424455
  • 105
  • 1
  • 8
6
votes
2 answers

Dependency management: subprocess32 needed for Python2.7

I have a library (subx) which depends on subprocess32. The subprocess32 library is a backport for Python2.7 and provides the timeout kwarg. My library needs the timeout kwarg. I need subprocess32 only if the target platform is Python2.x. How should…
guettli
  • 25,042
  • 81
  • 346
  • 663
5
votes
2 answers

setup.py: require a recent version of setuptools before trying to install

I'm creating a package that has 'typing;python_version<"3.5"' in it's install_requires. Apparently, this kind of dependency specification has only been implemented in recent versions of setuptools. If the setuptools on the user's machine is old…
AXO
  • 8,198
  • 6
  • 62
  • 63
3
votes
1 answer

Failing to install dependencies for a custom project

So I am having a project that is meant to be able to be distributed and it is dependent on some other pip-installable modules. That is how setup.py looks like: import setuptools from rss_reader.rss_reader import…
H8oddo
  • 123
  • 9
2
votes
1 answer

why pip reinstalls standard packages listed in install_requires

There is a python package that I need to install using pip install SomePackage.tar.gz. In the setup.py of this package, a few libraries that are listed under install_requires have become part of Python 2.7 Standard Library (like argparse). The…
farmir
  • 1,259
  • 1
  • 10
  • 14
1
vote
0 answers

Dynamic package installation depend upon the specific system using setup.py install_requires

I have a setup.py as below configuration setup( install_requires = ['django == 2.0'] ) I would like to modify the setup.py based on docker usage. If user uses docker then the configuration must be setup( install_requires = ['django ==…
devel
  • 11
  • 2
1
vote
1 answer

Dependencies of Django Project

I created a setup.py and setup.cfg like explained in the Django docs. Now I am unsure how to add dependencies to my project. If someone installs my code, other tools like Pillow should automatically get installed. I read that install_requires is the…
guettli
  • 25,042
  • 81
  • 346
  • 663
1
vote
0 answers

Can setup include_requires circumvent the best match in PyPI and clone the repo?

The master branch of SHAP fixes a clash with XGBoost, which is not fixed in the latest PyPI version: 0.35.0. Both SHAP and XGBoost are included in the list for install_requires in setup. I have tried the following (and many variants): 'shap @…
sunspots
  • 1,047
  • 13
  • 29
1
vote
1 answer

How does the dependency resolution works with pip when a package specify a range and another doesn't?

I have a requirement.txt with only 2 dependencies: sentry-sdk==0.7.11 requests==2.21.0 I've checked the setup.py of both packages and both depend on urllib3: request provides a range that does not accpet the 1.25 sentry-sdk instead does not…
cunfusu
  • 97
  • 1
  • 9
0
votes
0 answers

Specifying extras_requires of a package installed by setup.py in python?

I want to use mypy-boto3 for type annotations in a project installed with setup.py. Unfortunately this usedhs extra requires so you need to install it like so: pip install mypy-boto3[s3] (as documented here). This doesn't seem to work in…
Att Righ
  • 1,439
  • 1
  • 16
  • 29
0
votes
0 answers

Credentials are not prompted when using python "install_requires" with privat git repository

I'm installing a private python package that is dependent on another python package on a private git repository on a local server. In my setup.py I use the following: name = packageToBeInstalled install_requires=[ 'packageRequired @…
1
2