Cory
Cory

Reputation: 15605

How to use setup.py to install dependencies only?

I am not interested in installing my package itself but I am interested installing all the dependencies used by my package. Is there a way to do this using setup.py? It seems setup.py installs my package and all dependencies.

Upvotes: 27

Views: 8243

Answers (3)

Charlie Parker
Charlie Parker

Reputation: 5201

if you wan to do it from setup.py do:

python setup.py egg_info
pip install -r *.egg-info/requires.txt
rm -rf *.egg-info/

all of this ran from the project folder usually for me it's the root of my github where setup.py is.

credits: https://stackoverflow.com/a/53251585/1601580

Upvotes: 1

Ken Williams
Ken Williams

Reputation: 23965

The only way I've found to reliably do this in a straightforward manner is this:

pip install . && pip uninstall `python setup.py --name`

Upvotes: 14

Nicolas Appriou
Nicolas Appriou

Reputation: 2331

Use the -e flag on pip install

pip install -e .

Upvotes: 17

Related Questions