I have a script that creates a virtualenv
, installs distribute
and pip
in it and then optionally clones a git
repo.
Now I have the project I will be working on, installed. But its dependencies are not installed. How can I make pip
install all the dependencies as if I have issued a pip install MyApp
?
EDIT: Appareantly my question is a duplicate of this one.
Not exactly sure but pip install -e .
seems to do what I want without too many extra stuff lying around. I'd prefer if my code wasn't linked from site-packages
though.
Pip relies on package authors to stipulate the dependencies for their code in order to successfully download and install the package plus all required dependencies from the Python Package Index (PyPI).
Unfortunately, pip makes no attempt to resolve dependency conflicts. For example, if you install two packages, package A may require a different version of a dependency than package B requires. Pip can install from either Source Distributions (sdist) or Wheel (. whl) files.
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.
If your dependencies are defined in the setup.py
file, you can first dump them to an external file using:
python setup.py egg_info
This will list all your dependencies in YOUR_PROJECT.egg-info/requires.txt
file. Then you can install them using pip
:
pip install -r *.egg-info/requires.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With