3

Normally you would want all packages to declare their dependencies, but sometimes this is out of your control and "fork it" is not done easily for large or complicated packages.

For instance, SciPi requires NumPy, but does not specify it. So for packages out of your control is there a way to tell setup.py or pip to install in a specific order?

NorthIsUp
  • 17,502
  • 9
  • 29
  • 35

1 Answers1

2

4/13/2015 UPDATE: As @Garrrett commented, the installation order behavior changed in pip v6.1.0. Taken from pip v7.0.0.dev0 docs:

As of v6.1.0, pip installs dependencies before their dependents, i.e. in "topological order". This is the only commitment pip currently makes related to order. While it may be coincidentally true that pip will install things in the order of the install arguments or in the order of the items in a requirements file, this is not a promise.


Initial answer (outdated):

Use a requirements file with pip. Since 0.8.3 version pip installs the packages in the order they are listed in the requirement file.

Community
  • 1
  • 1
Hugo Lopes Tavares
  • 28,528
  • 5
  • 47
  • 45
  • Related: [Non-alphabetical installation of requirements](https://github.com/pypa/pip/issues/24) bug in pip's github repo. – Piotr Dobrogost Jul 18 '13 at 21:55
  • 1
    This answer is incorrect. `As of v6.1.0, pip installs dependencies before their dependents, i.e. in "topological order". This is the only commitment pip currently makes related to order. While it may be coincidentally true that pip will install things in the order of the install arguments or in the order of the items in a requirements file, this is not a promise.` ([ref](https://github.com/pypa/pip/blob/develop/docs/reference/pip_install.rst#installation-order)) – Garrett Apr 08 '15 at 22:32
  • This is a new feature, @Garrett, thanks for commenting. It would be cool if you answered OP's question with the new information and OP marked your answer as correct. – Hugo Lopes Tavares Apr 13 '15 at 15:27