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

Discussion in 'Python' started by vsoler, Aug 4, 2010.

  1. vsoler

    vsoler Guest

    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)

    Should I change the PATH in Windows? Should I change the PYTHONPATH? I
    am a bit lost. Everything worked fine with 2.6.

    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?

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

    Any help is highly appreciated.

    Vicente Soler
    vsoler, Aug 4, 2010
    #1
    1. Advertising

  2. vsoler

    Alex Willmer Guest

    On Aug 4, 2:35 pm, vsoler <> 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.
    Alex Willmer, Aug 4, 2010
    #2
    1. Advertising

  3. vsoler

    vsoler Guest

    On Aug 4, 5:41 pm, Alex Willmer <> wrote:
    > On Aug 4, 2:35 pm, vsoler <> 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.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.


    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.

    If I go to the Control Panel, I cannot see any of the above suposedly
    removed programs as pending of removal, so I really do not know what
    more to do. I was even thinking of removing the C:\python26 directory
    with the Supr key, but I always heard that it is not a good idea, the
    Registry could become inconsistent. Additionally, I have not found in
    my Win7 system nay utility for fixing it, should it become corrupt.

    Perhaps my questions concern a bit more the Operating system (windows)
    than they do python, but since I am fond of python and I definitely
    would like to become somehow proficient at it, I would like to solve
    the problem that I have.

    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?

    Thank you very much for your help.

    Vicente Soler
    vsoler, Aug 4, 2010
    #3
  4. vsoler

    Alex Willmer Guest

    On Aug 4, 5:19 pm, vsoler <> wrote:
    > On Aug 4, 5:41 pm, Alex Willmer <> wrote:
    >
    >
    >
    >
    >
    > > On Aug 4, 2:35 pm, vsoler <> 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.
    Alex Willmer, Aug 4, 2010
    #4
  5. vsoler

    vsoler Guest

    On Aug 4, 7:52 pm, Alex Willmer <> wrote:
    > On Aug 4, 5:19 pm, vsoler <> wrote:
    >
    >
    >
    > > On Aug 4, 5:41 pm, Alex Willmer <> wrote:

    >
    > > > On Aug 4, 2:35 pm, vsoler <> 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.


    Thank you very much Alex
    vsoler, Aug 4, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shawn
    Replies:
    1
    Views:
    435
    Shawn
    Feb 7, 2005
  2. Darcy Kahle
    Replies:
    2
    Views:
    349
    Michael Foord
    Aug 10, 2004
  3. luis
    Replies:
    1
    Views:
    865
    Larry Bates
    Jul 25, 2007
  4. wazza
    Replies:
    1
    Views:
    1,953
    wazza
    Aug 4, 2010
  5. Ruby Quiz

    [QUIZ] FizzBuzz (#126)

    Ruby Quiz, Jun 1, 2007, in forum: Ruby
    Replies:
    153
    Views:
    1,209
    Brad Phelan
    Jun 11, 2007
Loading...

Share This Page