How to Install Pycrypto on Windows

How do I install PyCrypto on Windows?

If you don't already have a C/C++ development environment installed that is compatible with the Visual Studio binaries distributed by Python.org, then you should stick to installing only pure Python packages or packages for which a Windows binary is available.

Fortunately, there are PyCrypto binaries available for Windows:
http://www.voidspace.org.uk/python/modules.shtml#pycrypto

UPDATE:
As @Udi suggests in the comment below, the following command also installs pycrypto and can be used in virtualenv as well:

easy_install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1.win32-py2.7.exe

Notice to choose the relevant link for your setup from this list

If you're looking for builds for Python 3.5, see PyCrypto on python 3.5

Problem installing pycrypto on windows 10

2017-01-03 Building pycrypto on Windows Solved my problem. Earlier I tried the same solution, but I think I was doing something wrong that time

Microsoft Windows Python-3.6 PyCrypto installation error

The file include\pyport.h in Python installation directory does not have #include < stdint.h > anymore. This leaves intmax_t undefined.

A workaround for Microsoft VC compiler is to force include stdint.h via OS environment variable CL:

  1. Open command prompt
  2. Setup VC environment by runing vcvars*.bat (choose file name depending on VC version and architecture)
  3. set CL=-FI"Full-Path\stdint.h" (use real value for Full-Path for the environment)
  4. pip install pycrypto

can't install pycrypto, python 3.10, how to fix?

I'd wager something is missing, or that version of Pycrypto just doesn't work on your Python 3.10 on 64-bit Windows. (Pycrypto hasn't been updated since 2013. You probably don't want to use it.)

Could you get whatever you want done with cryptography, i.e. pip install cryptography? There seem to be pre-compiled wheels for Windows for it.

There's also a fork of pycryptodome, pycryptodomex, that might help.

Failed installing pycrypto with pip

The solution was simple

just

    pip uninstall pycrypto
pip install pycryptodome

And every should just work fine, it worked for me!

How to install pycrypto in pycharm?

It looks like there's a problem in the version of pycrypto/pycryptodome that you're installing. The lines prior to the one in your question should contain details about what this is. It could be that this distribution doesn't work on windows, doesn't specify all the dependencies it needs or one of many other problems. If you can post the entire error we should be able to give more advice.

You could try installing an early version to see if that works, the current version of pycryptodome is 3.10.1 so try pip install pycryptodome==3.9.9 which is the previous version in PyPI.

Another thing you can do is install the distribution a different way. Try downloading the .tar.gz archive of the package and pip installing that file e.g. pip install pycryptodome-3.10.1.tar.gz

Both of these solutions may work but it's impossible to say without knowing the precise problem with the install.


On pycrypto github there seem to be a lot of installation problems and the recommendation is) to use pycryptodome instead.



Related Topics



Leave a reply



Submit