Import Winreg in a Python Script
<p>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 <strong>import winreg</strong> module does not exist. </p>

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

<p>Is there no other way to solve this than to switch over to a Windows machine? </p>

<p>Thanks</p>

<p>It makes sense, the <a href="https://docs.python.org/2/library/_winreg.html#module-_winreg" rel="nofollow">_winreg docs</a> says:</p>

<blockquote>
  <p>These functions expose the Windows registry API to Python.</p>
</blockquote>

<p>You could try to make it run on a windows virtual machine in your centos host or just following the official <a href="https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions" rel="nofollow">Installing+Jenkins+on+Red+Hat+distributions</a> guide</p>

python winreg