There are some specific things you will want to do to install Python on Windows as it will act differently than it would on a linux machine. Some of the steps are specific to running scripts for Nexus (NX-OS). This article was written by Jeff Allen at Cisco.
- Install Python 2.x (do not install 3.x) from here . I chose Python 2.7 and I chose 32bit because I assume it is more compatible with other stuff but I have basis to back that up.
You will then need Python for Windows Extensions installed from here.Click the latest build and download the one matched to your version of python and 32bit/64bitInstall it – if it complains that Python was not found in your registry, add the python path (c:\python27) to this key:HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPathChange the (default) string value on the right to be your python path (c:\python27)
- In order to run the “install” scripts for Python packages like WinPexpect (step 4), you need something called “setuptools”. Download it here.
Download the ez_setup.py file here.Go to a command prompt and run ‘ez_setup.py’ from the downloads folder
You need Pexpect in order to run a lot of Nexus scripts and Pexpect for Windows is called WinPexpect. Download it from here.Save it to a folder inside the python path (c:\python27\pexpect)
From a command prompt run:12cd C:\python\27\pexpectSetup.py install
Download and install the correct version (for your Python) of the lxml parser which the NXOS modules use here
- Download the 9K tgz from here.
- Install 7zip to unzip it. There are some folders inside that you need to move to the correct place. You will need to make sure that in the end you have: