distutils bdist_wininst failure on Linux

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Feb 23 15:06:22 CET 2012


Following instructions here:

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

I am trying to create a Windows installer for a pure-module distribution 
using Python 3.2. I get a "LookupError: unknown encoding: mbcs"

Here is the full output of distutils and the traceback:


[steve at ando pyprimes]$ python3.2 setup.py bdist_wininst
running bdist_wininst
running build
running build_py
creating build/lib
copying src/pyprimes.py -> build/lib
installing to build/bdist.linux-i686/wininst
running install_lib
creating build/bdist.linux-i686/wininst
creating build/bdist.linux-i686/wininst/PURELIB
copying build/lib/pyprimes.py -> build/bdist.linux-i686/wininst/PURELIB
running install_egg_info
Writing build/bdist.linux-i686/wininst/PURELIB/pyprimes-0.1.1a-py3.2.egg-info
creating '/tmp/tmp3utw4_.zip' and adding '.' to it
adding 'PURELIB/pyprimes.py'
adding 'PURELIB/pyprimes-0.1.1a-py3.2.egg-info'
creating dist
Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.
Traceback (most recent call last):
  File "setup.py", line 60, in <module>
    "License :: OSI Approved :: MIT License",
  File "/usr/local/lib/python3.2/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.2/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.2/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.2/distutils/command/bdist_wininst.py", line 179, in run
    self.create_exe(arcname, fullname, self.bitmap)
  File "/usr/local/lib/python3.2/distutils/command/bdist_wininst.py", line 262, in create_exe
    cfgdata = cfgdata.encode("mbcs")
LookupError: unknown encoding: mbcs


How do I fix this, and is it a bug in distutils?



-- 
Steven



More information about the Python-list mailing list