Import Winreg in a Python Script
Question: I am currently working on a Jenkins freestyle job and one of the build steps
is to run a Python script. I have been working on this job for a couple of
days now and this is one of the last build steps needed to finish it off. I
have reached a point where I get an error letting me know that the **import
winreg** module does not exist.

I have installed Jenkins on CentOS and have read some documentation stating
that I am unable to import this module on this distribution.

Is there no other way to solve this than to switch over to a Windows machine?

Thanks


Answer: It makes sense, the [_winreg
docs](https://docs.python.org/2/library/_winreg.html#module-_winreg) says:

> These functions expose the Windows registry API to Python.

You could try to make it run on a windows virtual machine in your centos host
or just following the official
[Installing+Jenkins+on+Red+Hat+distributions](https://wiki.jenkins-
ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions) guide

