<p>This worked for me. Download the package from here. I personally tested this for Python 3.4 and Windows 64 bit.
<a href="https://www.dropbox.com/s/n6rckn0k6u4nqke/pycrypto-2.6.1.zip?dl=0" rel="nofollow">https://www.dropbox.com/s/n6rckn0k6u4nqke/pycrypto-2.6.1.zip?dl=0</a></p>

<ul>
<li><p>Select your architecture and install the exe file.</p></li>
<li><p>This will create a Lib folder in your python directory. My python was
installed in C:\python3.4. This software created a directory in
C:\   .The directory was named "Lib".</p></li>
<li><p>Inside lib there is "site-packages".
Copy everything under site-packages (only two folders - <code>Crypto</code> and <code>*.egg-info</code>) and then paste where your
python's site-package is. E.g. I am using virtualenv and my path was
C:\Users\RChaudhary\Programs\PythonVirtualEnvironment\bookeeping.frontend\Lib\site-packages</p></li>
<li>I pasted my files here and voila, it works. pip3.4 list showed my the
package and my program also runs correctly.</li>
<li>From your program manager, uninstall what you installed earlier. Your pycrypto will still work.</li>
</ul>

CC BY-SA 3.0
2015-05-19T05:06:45.763Z
` From your program manager, uninstall...` that's good to know!
Wizard Of Ozzie
CC BY-SA 3.0
2015-05-19T14:07:10.967Z
Lol! Sorry about that. I have a habit of cleaning. So I cannot stand having unwanted files on my system.
Rash
CC BY-SA 3.0
2015-05-19T23:06:50.787Z
I was being serious FWIW
Wizard Of Ozzie
CC BY-SA 3.0
2015-05-18T18:55:04.707Z
2015-05-18T18:55:04.707Z
Rash
<p>Binaries available for <strong>Python 3.4</strong>: </p>

<ul>
<li><a href="https://github.com/axper/python3-pycrypto-windows-installer" rel="nofollow noreferrer">https://github.com/axper/python3-pycrypto-windows-installer</a> 32 &amp; 64 bits</li>
</ul>

<p>As <a href="https://stackoverflow.com/a/21829189/3936486">outlined here on SE</a>, binaries available for <strong>Python 2.x - 3.3</strong>:</p>

<ul>
<li><a href="http://www.voidspace.org.uk/python/modules.shtml#pycrypto" rel="nofollow noreferrer">http://www.voidspace.org.uk/python/modules.shtml#pycrypto</a></li>
</ul>

<p>This solves the dependencies issues error <code>compile failed with error code 1</code> using pip. Also, the following error screen (at the CLI) should not be appearing any more following installation, via pip or <em>setup install</em>, of <a href="https://pypi.python.org/pypi/pycrypto" rel="nofollow noreferrer">pycrypto</a> dependent libraries!</p>

<pre><code>Skipping implicit fixer: ws_comma
running build_ext
building 'Crypto.Random.OSRNG.winrandom' extension
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
error: Unable to find vcvarsall.bat
</code></pre>

CC BY-SA 3.0
2015-02-12T06:12:51.343Z
2015-02-12T06:12:51.343Z
2017-05-23T12:34:59.703Z
Wizard Of Ozzie
<p>Whilst there's less of an issue with Python 2.7, Python 3.4 relies on the pycrypto library for numerous wrappers/APIs/tools such as BlockTrail, pycoin, pybitcointools, etc etc. </p>

<p>The error I'm getting:</p>

<pre><code>building 'Crypto.Random.OSRNG.winrandom' extension

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

error: Unable to find vcvarsall.bat
</code></pre>

<p>It's <a href="https://stackoverflow.com/questions/21829188/error-unable-to-find-vcvarsall-bat-when-installing-fabric-python-library-on">an issue with the gcc C++ compiler for Windows</a>, I understand, however the binaries offered in that solution, sadly, don't cover Python 3.4 (version for 3.<strong>3</strong> won't cut it, unfortunately).</p>

<p>A solution - other than installing <em>pseudo-Posix (ie Ming32)</em> - would be very useful for those transitioning to Python 3.x<code>enter preformatted text here</code></p>

<development><windows><python>
Solving PyCrypto 2.6.1 errors for Python 3.4 (Windows7 x64)?
Wizard Of Ozzie
# Solving PyCrypto 2.6.1 errors for Python 3.4 (Windows7 x64)?

(Asked by: username_0 on 2015-02-12)

Whilst there's less of an issue with Python 2.7, Python 3.4 relies on the pycrypto library for numerous wrappers/APIs/tools such as BlockTrail, pycoin, pybitcointools, etc etc. 
The error I'm getting:
building 'Crypto.Random.OSRNG.winrandom' extension

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

error: Unable to find vcvarsall.bat

It's an issue with the gcc C++ compiler for Windows, I understand, however the binaries offered in that solution, sadly, don't cover Python 3.4 (version for 3.3 won't cut it, unfortunately).
A solution - other than installing pseudo-Posix (ie Ming32) - would be very useful for those transitioning to Python 3.xenter preformatted text here

**Tags:** development, windows, python


---

## 2 answers

### Answer by username_1 on 2015-05-18. Score: 1 | Accepted answer

This worked for me. Download the package from here. I personally tested this for Python 3.4 and Windows 64 bit.
<https://www.dropbox.com/s/n6rckn0k6u4nqke/pycrypto-2.6.1.zip?dl=0>

* Select your architecture and install the exe file.
* This will create a Lib folder in your python directory. My python was
  installed in C:\python3.4. This software created a directory in
  C:\ .The directory was named "Lib".
* Inside lib there is "site-packages".
  Copy everything under site-packages (only two folders - `Crypto` and `*.egg-info`) and then paste where your
  python's site-package is. E.g. I am using virtualenv and my path was
  C:\Users\RChaudhary\Programs\PythonVirtualEnvironment\bookeeping.frontend\Lib\site-packages
* I pasted my files here and voila, it works. pip3.4 list showed my the
  package and my program also runs correctly.
* From your program manager, uninstall what you installed earlier. Your pycrypto will still work.

> **Comments:**
> **username_0**: ` From your program manager, uninstall...` that's good to know!  
> **username_1**: Lol! Sorry about that. I have a habit of cleaning. So I cannot stand having unwanted files on my system.  
> **username_0**: I was being serious FWIW  

---

### Answer by username_0 on 2015-02-12. Score: 2

Binaries available for Python 3.4: 

https://github.com/axper/python3-pycrypto-windows-installer 32 & 64 bits

As outlined here on SE, binaries available for Python 2.x - 3.3:

http://www.voidspace.org.uk/python/modules.shtml#pycrypto

This solves the dependencies issues error compile failed with error code 1 using pip. Also, the following error screen (at the CLI) should not be appearing any more following installation, via pip or setup install, of pycrypto dependent libraries!
Skipping implicit fixer: ws_comma
running build_ext
building 'Crypto.Random.OSRNG.winrandom' extension
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
error: Unable to find vcvarsall.bat


---

