askvictor
askvictor

Reputation: 3819

Python packages on windows: pip or native installers?

What are the relative merits of installing python packages on windows using pip as opposed to using packaged installers (exe/msi)?

Upvotes: 3

Views: 872

Answers (2)

Piotr Dobrogost
Piotr Dobrogost

Reputation: 42405

Native installers are used mainly when a package contains C extensions that need to be compiled. As you have to use the same compiler used to build Python itself and configure environment properly it's not something that many users see themselves doing. To avoid these problems they instead choose native installer. However, installing by running exe/msi installer directly doesn't allow to choose which Python instance to install a package in so you can't install in virtualenv. This seems like a major drawback of using native installers but only because many people are not aware of the fact that it is possible to use native installer to install in virtualenv - see Can I install Python windows packages into virtualenvs? (Unfortunately in this case you can't use pip as it doesn't handle installing binary packages).

To summarize:

  1. If a package has no C extensions use pip
  2. If a package has C extensions and
    1. you can find native installer or binary egg use easy_install with native installer/binary egg
    2. you can't find native installer nor binary egg use pip to compile C extensions and install package

Upvotes: 2

yurisich
yurisich

Reputation: 7109

For starters, some just wouldn't work for me (MySQLdb being the major culprit).

My new rule:

  1. Try pip or easy_install
  2. If that doesn't work, browse this library of python .msi/.exe installers for Windows.

If neither works for you, post a question on StackOverflow. You really have no benefit weighing the merits of one or the other; just get what you need in the manner that provides the least friction, and move on to more interesting things.

Upvotes: 3

Related Questions