views:

259

answers:

2

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.

+3  A: 

You should use the pip requirements file.

Essentially, place all your requirements, one in each line in a file and pass that to pip using the command

pip install -r requirements.txt

What more, if you have a standard environment, pip can actually dump such a file from existing installs using the command:

pip freeze

You can put the file thus generated directly into the pip requirements, and call the previous command from your deployment script.

Pretty cool, isnt it? :)

Lakshman Prasad
Cool, but it doesn't answer my question. I'm not looking for a way to define dependencies. Reading questions entirely and carefully helps goes a long way in providing correct answers.
muhuk
Wait, You can put all your dependencies in a file and ask pip to install them all for you. Isn't that what you are looking for? If not, I didn't properly understand your question. Even now.
Lakshman Prasad
+1  A: 

In my package root issuing pip install -e . installs dependencies.

muhuk