TimeWillTell
TimeWillTell

Reputation: 189

PyCrypto 2.6 Installation Issue

I downloaded the tar.gz file and extracted the folder, navigated to the directory in which it was stored, and typed in command prompt

python setup.py install

Which was supposed to install it, obviously. However, when I did this, I got back

running install
running build
running build_py
running build_ext
warning: GMP or MPIR library not fou

building 'Crypto.Random.OSRNG.winran
error: Unable to find vcvarsall.bat

If possible, how can I fix this. I'm running Windows 8 (64 bit), I have Python 3.3, and I downloaded PyCrypto 2.6.

Also, someone said to download the prepackaged binary. I should have mentioned that I've tried that already. When I import it, the shell gives me another error.

ImportError: DLL load failed: %1 is not a valid Win32 application.

Right, so I found the cryptography module that was created by those who created Python, so I've decided to use that instead.

Upvotes: 1

Views: 1779

Answers (1)

Padraic Cunningham
Padraic Cunningham

Reputation: 180411

There are binary packages here Prebuilt Python Binaries for Windows

If you are using python 3.4 pip is already installed.

If you don't:

To install pip download this file pypi

After you download it, run it with python get-pip.py.

Add setx PATH "%PATH%;C:\Pythonx\Scripts" where x is your python version or cd to C:\Pythonx\Scripts and run pip install pycrypto

After installing Visual Studio 2010 C++ Express.

set:

LIBPATH = C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 10\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 10\VC\LIB;C:\Python33\Lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%LIBPATH%
PATH = C:\Program Files (x86)\Microsoft Visual Studio 10\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 10\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 10\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 10\VC\VCPackages;%WindowsSdkDir%bin;C:\Python33\Scripts;C:\Python33;%PATH%
INCLUDE = C:\Program Files (x86)\Microsoft Visual Studio 10\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 10\VC\INCLUDE;%WindowsSdkDir%include;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\Python33\include;%INCLUDE%
LIB = C:\Program Files (x86)\Microsoft Visual Studio 10\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 10\VC\LIB;%WindowsSdkDir%lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;C:\Python33\Lib;%LIB%

And pip install pycrypto again.

Upvotes: 1

Related Questions