import _winreg does not work. How do I fix?

Discussion in 'Python' started by John Sellers, Nov 24, 2003.

  1. John Sellers

    John Sellers Guest

    newbee question...I haven't worked on Python since Python 1.5.2


    cygwin setup installs Python 2.3.2-1 on Windows XP

    however:


    $ python
    Python 2.3.2 (#1, Oct 9 2003, 12:03:29)
    [GCC 3.3.1 (cygming special)] on cygwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> from _winreg import *

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    ImportError: No module named _winreg
    >>>




    WHY??
    John Sellers, Nov 24, 2003
    #1
    1. Advertising

  2. John Sellers

    Miki Tebeka Guest

    Hello John,

    > >>> from _winreg import *

    > Traceback (most recent call last):
    > File "<stdin>", line 1, in ?
    > ImportError: No module named _winreg
    > >>>

    There is no _winreg on cygwin, only on "true" win32 python.
    If you must use cygwin you can either patch _winreg to work for you or
    use cygwin's regtool (try regtool --help)

    HTH.
    Miki
    Miki Tebeka, Nov 24, 2003
    #2
    1. Advertising

  3. John Sellers

    John Sellers Guest

    Sounds reasonable, but if what you say is true, I am surprised that not
    all Python 2.3.2 releases are not equal.

    How good is your information? Is it authorative?

    ===

    I need to be in cygin because I have an extensive integrated environment
    which includes many cygwin packages, and several python 3rd party packages.

    I could hack it with a true win32 python, but my gut says this is not
    the way to go.



    Miki Tebeka wrote:
    > Hello John,
    >
    >
    >> >>> from _winreg import *

    >>Traceback (most recent call last):
    >> File "<stdin>", line 1, in ?
    >>ImportError: No module named _winreg
    >> >>>

    >
    > There is no _winreg on cygwin, only on "true" win32 python.
    > If you must use cygwin you can either patch _winreg to work for you or
    > use cygwin's regtool (try regtool --help)
    >
    > HTH.
    > Miki
    John Sellers, Nov 24, 2003
    #3
  4. John Sellers

    Miki Tebeka Guest

    Hello John,

    > Sounds reasonable, but if what you say is true, I am surprised that not
    > all Python 2.3.2 releases are not equal.
    >
    > How good is your information? Is it authorative?

    It's not authorative. It's experience :)

    See Jimmy's mail about OS differences. If you want Python to be the
    same in all OS's you'll get the lowest common subset of functionality.

    > I could hack it with a true win32 python, but my gut says this is not
    > the way to go.

    You can either write a module that wraps regtool. Another way is to
    write
    a C module that does registry work and use SWIG, Boost, ... to make it
    a Python module.
    Yet another option is to write the .reg file and let Windows handle
    it.

    IMO if runtime is not that important create a winreg module the uses
    regtool.

    HTH.
    Miki.
    Miki Tebeka, Nov 26, 2003
    #4
    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. Xah Lee
    Replies:
    22
    Views:
    1,105
    Tim Roberts
    Mar 21, 2006
  2. Jimmy Retzlaff
    Replies:
    0
    Views:
    463
    Jimmy Retzlaff
    Nov 25, 2003
  3. Xah Lee
    Replies:
    23
    Views:
    1,041
    Tim Roberts
    Mar 21, 2006
  4. 3c273
    Replies:
    3
    Views:
    265
    Fredrik Lundh
    May 19, 2006
  5. Xah Lee
    Replies:
    21
    Views:
    763
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page