How to Install Paramiko and PyCrypto in Mac OS X the Easy Way
Paramiko is an SSH module for python that allows for secure connections to be made, and pycrypto is a cryptography toolkit for python.
Whether you need one or the other, or both, the easiest way to get them both installed through Mac OS X is through paramiko. No need to use HomeBrew, MacPorts, or any funky installers, you can do the entire thing yourself rather quickly. If you have no idea what I’m talking about, you probably don’t need any of this.
- Xcode 4.3 (App Store link) or later installed including Command Line Tools or install GCC and Command Line Tools without Xcode
- Get Paramiko 188.8.131.52+ (or whatever the newest version is), this package includes PyCrypto
It is absolutely critical that gcc and the OS X command line tools are installed before beginning the installation process. Trying to build and install paramiko and pycrypto will fail with a variety of errors ranging from “autoconf error” to “ImportError: No module named Crypto” – if you encounter either of those errors it’s because Xcode’s command line tools are not installed yet.
Installing paramiko and pycrypto
Assuming you have GCC and python installed in OS X now, here’s the incredibly simple installation process:
- Unzip the Paramiko archive and cd to that directory
- Type the following command:
sudo easy_install ./
That’s it. The process is extremely quick if you have the dependencies, so grab Xcode and install the optional command line tools before beginning and be on your way.
Remember, installing Xcode on it’s own from the App Store does not install the command line tools by default, they are optional. That’s new to the App Store installation method, and frankly it hung me up for a few minutes figuring out why builds were failing on a newly formatted Mac, so I’m sure this information will help out someone else too.