No module named Crypto.PublicKey

When I tried to import the paramiko module, I got following error:

No module named Crypto.PublicKey

That means we need to install pycrypto library. Run following command to install pycrypto library by using pip:

In the installation process I got a another error message:

error: Unable to find vcvarsall.bat

That means we need a C compiler to compile this extension. But we can also download a pre-built extension for windows:


After installing this extension and tried to import "paramiko" module, I got the same error "No module named Crypto.PublicKey" again. This is because the installer installs pycrypto library with lowercase name, but paramiko tries to import it with uppercase name. We should rename crypto directory under "Lib/site-packages" to Crypto, then importing paramiko will work.