nltk/nltk — Issue #46: Distribute NLTK as .msi 
Author: alexrudnick
Created: 2012-01-17 06:24:46+00:00
State: open

Describe the feature you would like us to add.

The NLTK download page currently lists the following as the Windows
distribution:

http://nltk.googlecode.com/files/nltk-0.9.7.win32.exe

This was presumably created with something like "python setup.py
bdist_wininst". As of Python 2.5, you can now instead use "python setup.py
bdist_msi" to get a nice .msi installer (which in my experience is much
nicer than the old .exe installers).

Migrated from http://code.google.com/p/nltk/issues/detail?id=219

earlier comments

StevenBird1 said, at 2009-01-29T01:36:45.000Z:

The distutils package has a method distutils.command.bdist_msi, however this doesn't appear to be
accessible from setup.py (see list of supported formats below), nor is it mentioned in the distutils
documentation section on creating windows installers:

http://docs.python.org/distutils/builtdist.html#creating-windows-installers

python setup.py bdist --help-formats
List of available distribution formats:
--formats=rpm RPM distribution
--formats=gztar gzip'ed tar file
--formats=bztar bzip2'ed tar file
--formats=ztar compressed tar file
--formats=tar tar file
--formats=wininst Windows executable installer
--formats=zip ZIP file

(Please reopen this if you discover some way to build an MSI package.)

steven.bethard said, at 2009-01-29T03:06:28.000Z:

It works for me. And it's in both the 2.5 and 2.6 documentation:

http://docs.python.org/dev/2.5/dist/module-distutils.command.bdistmsi.html
http://docs.python.org/distutils/apiref.html#module-distutils.command.bdist_msi

Here it is working on NLTK:

$ python setup.py bdist_msi
running bdist_msi
running build
running build_py
...
copying build\lib\nltk\book.py -> build\bdist.win32\msi\Lib\site-packages\nltk
creating build\bdist.win32\msi\Lib\site-packages\nltk\chat
copying build\lib\nltk\chat\eliza.py -> build\bdist.win32\msi\Lib\site-packages\nltk\chat
copying build\lib\nltk\chat\iesha.py -> build\bdist.win32\msi\Lib\site-packages\nltk\chat
...
Writing build\bdist.win32\msi\Lib\site-packages\nltk-0.9.6-py2.6.egg-info
removing 'build\bdist.win32\msi' (and everything under it)

$ dir /B dist
nltk-0.9.6.win32-py2.6.msi

I've filed a Python bug for the missing info in --help-formats:

http://bugs.python.org/issue5095

StevenBird1 said, at 2009-01-30T02:10:09.000Z:

Thanks for this. For python 2.5.1 and 2.5.2 running this setup command gives me: "error: invalid command
'bdist_msi'". It looks like you're using 2.6, and that distutils.command.bdist_rpm wasn't accessible via setup.py
before 2.6.

steven.bethard said, at 2009-02-01T18:11:55.000Z:

That's pretty odd. I just downloaded 2.5.4 (the most recent 2.5 available), and here
it is working there:

$ C:\Python25\python.exe setup.py bdist_msi
running bdist_msi
running build
running build_py
...

Seems odd that they'd introduce it in a point release. Are you running on a Windows
machine? Maybe .msi can only be created on a Windows machine?

StevenBird1 said, at 2009-02-21T01:44:59.000Z:

Carried forward to 0.9.9

StevenBird1 said, at 2009-06-21T10:46:16.000Z:

Mac Python 2.5.4 won't let me build a .msi package. Perhaps this is fixed in 2.6.
Anyway, I'd like to ask your help to post a .msi release for 2.0rc1 next week please.

steven.bethard said, at 2009-06-21T14:51:35.000Z:

Sure, no problem.