16

I need to create an installer for Windows which should be able to install a specific version of the Python interpreter (2.7) plus a set a dependencies such as ipython, numpy, pandas, etc.

Basically this is the same thing Active State did for their Active Python distribution: a single bundle including interpreter + deps.

Not being a Windows user I'm not sure where to start with this except maybe looking into NSIS (could that be of any help?).

Giampaolo Rodolà
  • 12,488
  • 6
  • 68
  • 60
  • 1
    AFAIK, the idea is to use `py2exe` or `cx_freeze` to make an executable and use NSIS or Inno Setup to make an installer. But never tried it. – KurzedMetal May 10 '12 at 13:35
  • 1
    Isn't py2exe intended to "freeze" a specific python application by turning it into an exe? The goal here is to create a bundled installer including the very Python iterpreter + a set of 3th party modules. – Giampaolo Rodolà May 10 '12 at 13:48
  • That's what "freeze" do, bundle a python executable/dll and the used modules in a `.exe`package. The only difference is that you don't actually install python system-wide and it doesn't break stuff or fail – KurzedMetal May 10 '12 at 13:52

3 Answers3

8

I suggest to use the packaging tool that I also use to build the Python releases, which is in Tools/msi/msi.py. Unpack the additional dependencies on top of the Python source (or an installation), then adjust msi.py to pick up all additional files that you want to package. You should adjust display strings to indicate that this is really a separate Python distribution.

Martin v. Löwis
  • 124,830
  • 17
  • 198
  • 235
5

For Windows there's pynsist. It uses NSIS internally and bundles Python so you don't have to. It comes with useful examples.

Disclaimer: I haven't tried pynsist yet, but will soon.

Florian Sesser
  • 5,972
  • 1
  • 25
  • 26
2

If you want to package a predetermined version of python and some dependencies, I would suggest, using NSIS and AutoIt.

NSIS can be used to embed other installer, but in the specific case of python modules, some of their installer can't be used in an unattended mode. To bypass this problem, AutoIt can be used to simulate keystrokes.

For more info on embedding other installer in NSIS: http://nsis.sourceforge.net/Embedding_other_installers

AutoIT web site: http://www.autoitscript.com/site/