Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 524
Cory Avatar asked Jun 12 '15 07:06

Cory


People also ask

How do I install Python packages from setup py?

Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.

How do I download Python packages with dependencies?

In this case, you have two options: Use the pipdeptree utility to gather a list of all dependencies, create a requirements. txt file listing all the dependencies, and then download them with the pip download command. Get the list of dependencies for a package from the setup.py file.


2 Answers

Use the -e flag on pip install

pip install -e .
like image 94
Nicolas Appriou Avatar answered Oct 14 '22 01:10

Nicolas Appriou


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

pip install . && pip uninstall `python setup.py --name`
like image 26
Ken Williams Avatar answered Oct 14 '22 00:10

Ken Williams