Reputation: 529
I am interested in running a script that is part of a rather large Python package. The package structure looks something like this:
MyApp
|
--setup.py
|
--MyApp
|
--foo
|
--scripts/some-tiny-script.py
some-tiny-script.py
only relies upon a few simple 3rd-party libs and the MyApp package itself.
I would like to only install the dependencies that some-tiny-script
requires without installing everything listed in the install_requires
section of the setup.py
file. This is because it contains many libraries, some of which are very large. I'm ok with identifying the libraries needed by some-tiny-script.py
and installing those with pip, but how do I install MyApp without installing everything listed under install_requires
?
Upvotes: 2
Views: 469
Reputation: 529
Thank you Mikko! I was confused by the overlap between what the pip install
and setup.py install
commands do. Here's what I ended up doing:
cd MyApp
(The one containing setup.py
)pip install -e --no-deps
This install MyApp. It also posts a lot of warnings but that's ok.pip
. GOTO 3.This is an unwieldy process for large scripts or apps but for small scripts it's doable and saves me multiple gigabytes of storage space in my Docker image.
Upvotes: 1