These instructions are community provided, tested with Python 2.7.5 and using the Junos PyEZ library version 0.1.2.
- OS X Mavericks
When you upgrade your Mac to OS X Mavericks, Apple deletes your X11 and any addons under /Library/Python/2.7/site-packages. There are plenty of posts on the Internet that describe how to restore your Python development environment, but this post will focus on the Juniper Junos PyEZ framework.
Github has Mac client available that includes command line tools and a native GUI app. - https://help.github.com/articles/set-up-git.
Install Homebrew - https://brew.sh.
If you have never used Python on your Mac, you will want to install X11 & Xcode. Some Python packages have dependencies that rely on these packages.
- Install X11 – The latest image can be found here.
- Install Xcode - https://developer.apple.com/xcode/ - you may have to register as a developer, but there is no charge to get access to Xcode.
- After Xcode is installed, install the command line tools.
- Open a Terminal window.
- Type:
xcode-select –install
- Install Git or the GitHub client.
- Create a symbolic link so that the tools we are about to install will compile without issues.
- Open a Terminal Window.
- Type:
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml/ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml
- NOTE: this is a single, long string.
- Install lxml with easy_install
- In a terminal window, type:
sudo easy_install lxml
- Easy_install works the best to install lxml
- Download the ncclient repository from Github.
- From a terminal window, navigate to the ncclient download directory. I save to a GitHub directory under ~/Documents.
cd Documents/GitHub/ncclient
sudo python setup.py install
- Download the py-junos-eznc repository from Github
- In the same terminal window, navigate to the py-junos-eznc directory
cd ../py-junos-eznc/
sudo python setup.py install
- Finally, I would install getpass, which is used in some scripts, using easy_install.
- sudo easy_install getpass