473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

import _winreg does not work. How do I fix?

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??

Jul 18 '05 #1
3 5855
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
Jul 18 '05 #2
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


Jul 18 '05 #3
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.
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Manlio Perillo | last post by:
Hi. I'm a new user of Python but I have noted a little problem. Python is a very good language but it is evolving, in particular its library is evolving. This can be a problem when, ad example,...
0
by: F. GEIGER | last post by:
Hi all, I use Leo for programming. Among other goodies Leo provides it let's me easily share code between different Python apps. When I have an app consisting of more than one file, they usually...
4
by: Brad Tilley | last post by:
The below function fails with this error: ValueError: Could not convert the data to the specified type. The problem appears to be the v variable. When I make v an int, I get: WindowsError: ...
9
by: monkey | last post by:
I just learn to make a blank windows frame with python and wxpython. I found the statment "import wx" cannot work as the original "from wxPython.wx import *". I see in the readme file of wxpython...
9
by: ajikoe | last post by:
Hello, I have two modules (file1.py and file2.py) Is that ok in python (without any weird implication) if my module import each other. I mean in module file1.py there exist command import file2...
1
by: mark | last post by:
In Access 2000 and 2002, I have created an import specification to import the fixed-width recordset below into an existing table. I am having strange problems with the import of the date and time...
0
by: rtilley | last post by:
A portion from the _winreg Documnetation: ----------------------------------------------------------------- DeleteValue(key, value) 1. Removes a named value from a registry key. --> OK 2. key is...
2
by: RodneyWMcBride | last post by:
Reply with quote Edit/Delete this post Delete this post Post _winreg.SaveKey question Does anyone know where I might find some sample code of using the saveKey function? I am getting an error 5...
2
by: Jonathan Fine | last post by:
Hello I'm using the _winreg module to change Windows registry settings, but its rather low level, and I'd prefer to be working with something more Pythonic. Does anyone have any...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.