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

Alex Willmer alex at moreati.org.uk
Wed Aug 4 13:52:22 EDT 2010


On Aug 4, 5:19 pm, vsoler <vicente.so... at gmail.com> wrote:
> On Aug 4, 5:41 pm, Alex Willmer <a... at moreati.org.uk> wrote:
>
>
>
>
>
> > 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 athttp://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.htmlhttp://docs.python...
>
> > > 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.
>
> Thank you Alex for your detailes reply.
>
> Before switching to Python 3.1.2 I removed all my Python 2.6 packages
> (python, pywin32, numpy, wxpython). However, the removal was not
> complete since some files could not be removed. Additionally, I still
> see my C:\python26 directory which is suposed not to exist any longer.

It probably contains one or two files the installers weren't aware of.
E.g. a module you added manually, a log, a .pyc

> I would not like to take a lot of your time, but, do you have any
> hints as to what I should do to 'tune' my PC?

Take a backup then either delete the Python26 directory, or rename it.
Any problems, reverse the process.




More information about the Python-list mailing list