26

I just started working on a project where I needed to install a lot of dependencies via pip. The instructions were to do everything manually.

I've used nodejs and maven before where this process is automated and the dependencies are isolated between projects. For example in node I can configure everything in package.json and just run npm install ik my project directory.

Is there something similar for pip?

auramo
  • 13,167
  • 13
  • 66
  • 88
  • 12
    I use `pip freeze` to list all dependencies and use -r option to generate a requirement.txt file. And then use `pip install -r requirement.txt` to install all. Take a look [here](http://pip.readthedocs.org/en/latest/reference/pip_freeze.html) – xbb Nov 17 '14 at 16:31
  • yeah, but `pip install -r requirement.txt` sucks if your merging projects. It pulls "double dependancy errors" if the same package is mentioned twice (__with the same__ version number even!). Nothing like `npm-deps`. I guess it was a dub idea to use a flat file to store dependancies in. – CpILL Dec 21 '15 at 03:03

2 Answers2

4

Check out anaconda. You can create lists of dependencies/packages and pass them to conda. Conda has most packages already, and will have everything soon. You can run pip through anaconda in case anaconda doesn't have the package you're looking for. Anaconda is great for both package and python version/environment management. Conda is the future!

Dan Quinn
  • 55
  • 1
0

One other way is to do...

easy_install `cat requirements.txt` 

This may be useful as some of the packages cannot be found in pip.

Community
  • 1
  • 1
benjaminz
  • 3,118
  • 3
  • 35
  • 47