The Application cannot locate win32ui.pyd (or Python) (126)

Alex Willmer alex at moreati.org.uk
Wed Aug 4 11:41:49 EDT 2010


On Aug 4, 2:35 pm, vsoler <vicente.so... at gmail.com> wrote:
> Hi all,
>
> I just installed python 3.1.2 where I used to have python 2.6.4. I'm
> working on Win7.
>
> The IDLE GUI works, but I get the following message when trying to
> open *.py files written for py 2.6
>
>         The Application cannot locate win32ui.pyd (or Python) (126)
>

win32ui is part of the PyWin32 package. Most likely you have a version
of PyWin32 for Python 2.6 installed, you should uninstall that and
install PyWin32 for Python 3.1. Downloads are at
http://sourceforge.net/projects/pywin32/files/

You should do the same for any other third party packages that are
installed.

> Moreover, when I try to open an old *.py file, I sometimes get a
> message saying that the file should be converted to UTF-8. What does
> this mean?

Those files contain non-ascii characters (e.g. £, €, æ). Non-ascii
characters must be encoded when saved using and encoding. UTF-8 is one
such encoding, and it was chosen as the default .py encoding for
Python 3.x. Those files are probably in iso8859, cp432, or perhaps
UTF-16 (aka UCS-2). You can save them in UTF-8 using your favourite
text editor, or declare the encoding so Python 3 knows it. More info:

http://www.joelonsoftware.com/articles/Unicode.html
http://docs.python.org/howto/unicode

> I'm also trying to use the 2to3 converter, but I cannot see where the
> converted files are written to!

I think 2to3 prints a diff of the file changes to the console. The -w
command line option should modify files in place.



More information about the Python-list mailing list