{"id":1374,"date":"2014-01-30T18:22:17","date_gmt":"2014-01-30T17:22:17","guid":{"rendered":"http:\/\/www.wmaus.net\/?p=1374"},"modified":"2020-11-12T20:07:34","modified_gmt":"2020-11-12T19:07:34","slug":"installing-paramiko-for-python-2-7-on-windows-8-1","status":"publish","type":"post","link":"https:\/\/www.wmaus.net\/?p=1374","title":{"rendered":"Installing Paramiko for Python 2.7 on Windows 8.1"},"content":{"rendered":"<p>I have the need to write a couple of Python skripts that can login to Linux servers via ssh and do some &#8220;magic&#8221; there. Like, for example, restart a stopped snmpd daemon. Or something like that. From what I&#8217;ve read, the Paramiko module for Python will be my friend here.<\/p>\n<p>The problem is that those Python modules will be triggered from a monitoring server running on 64-Bit Windows 2008, and my daily workhorse and development machine is running 64-Bit Windows 8.1. Accordingly, I also prefer to use the 64-Bit version of Python. (Just because, there is no real technical reason for that at this point in time.)<\/p>\n<p>I found these websites indispensable when it comes to Windows-installers for certain Python packages:<\/p>\n<p>http:\/\/blog.newitfarmer.com\/python\/library\/10781\/repost-unofficial-windows-binaries-for-python-extension-packages<\/p>\n<p>http:\/\/www.lfd.uci.edu\/~gohlke\/pythonlibs\/<\/p>\n<p>What you need from there are the packages named <em>Base-13.2.11-&lt;xyz&gt; <\/em>and<em> pip.<\/em><em><\/em><\/p>\n<p>In Windows, you should enhance your <em>PATH<\/em> variable not only to include the Python installation directory, but also to include the Python\\Scripts directory as well &#8211; because then you can run commands like &#8220;pip install paramiko&#8221; from the command line.<\/p>\n<p>Paramiko depends on the &#8220;Crypto&#8221; module, which it will implicitly load when you execute &#8220;import paramiko&#8221; in Python. A Windows installer for this package can be found here:<\/p>\n<p><a href=\"http:\/\/www.voidspace.org.uk\/python\/modules.shtml#pycrypto\">http:\/\/www.voidspace.org.uk\/python\/modules.shtml#pycrypto<\/a><\/p>\n<p>Download the file and run it.<\/p>\n<p>The fun part is that either Python or Windows 8.1 itself are quite case sensitive. The pycrypto Windows installer creates a lower-case folder &#8220;crypto&#8221;, but Paramiko uses an upper-case name to load the &#8220;Crypto&#8221; module. While this will work on Windows Server 2008 regardless, it will fail on Windows 8.1. So you have to go to the Python\\Lib\\site-packages folder and rename the folder &#8220;crypto&#8221; to &#8220;Crypto&#8221;.<\/p>\n<p>After that, install the Paramiko module via &#8220;pip install paramiko&#8221;.<\/p>\n<p>Now you can launch the Python interpreter and type &#8220;import paramiko&#8221;. If Python shows you the interpreter prompt without any messages at all, you should have a working Paramiko installation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have the need to write a couple of Python skripts that can login to Linux servers via ssh and do some &#8220;magic&#8221; there. Like, for example, restart a stopped snmpd daemon. Or something like that. From what I&#8217;ve read, the Paramiko module for Python will be my friend here. The problem is that those &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.wmaus.net\/?p=1374\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Installing Paramiko for Python 2.7 on Windows 8.1&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[4,27],"tags":[],"class_list":["post-1374","post","type-post","status-publish","format-standard","hentry","category-programming","category-python"],"_links":{"self":[{"href":"https:\/\/www.wmaus.net\/index.php?rest_route=\/wp\/v2\/posts\/1374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wmaus.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wmaus.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wmaus.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wmaus.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1374"}],"version-history":[{"count":1,"href":"https:\/\/www.wmaus.net\/index.php?rest_route=\/wp\/v2\/posts\/1374\/revisions"}],"predecessor-version":[{"id":1375,"href":"https:\/\/www.wmaus.net\/index.php?rest_route=\/wp\/v2\/posts\/1374\/revisions\/1375"}],"wp:attachment":[{"href":"https:\/\/www.wmaus.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wmaus.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wmaus.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}