pip install pycrypto
works fine with python3.5.2 but fails wiht python3.6 with the following error:
inttypes.h(26): error C2061: syntax e
For me this fixes it:
with Python 2, I have
sudo apt-get install python-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
...
with Python 3, I need
sudo apt-get install python3 python-dev python3-dev \
build-essential libssl-dev libffi-dev \
...
Installing python-dev python3-dev
fixes it for me!
Uninstall your current Python version
Install Python for amd64 architecture
Follow the other accepted solutions
set CL=-FI"%VCINSTALLDIR%Tools\MSVC\14.11.25503\include\stdint.h"
pip install pycrypto
I've succeeded install pycrypto 2.6.1 on python 3.6, Windows 10, Visual Studio 2017.
Open "x86_x64 Cross-Tools Command Prompt for VS 2017" with administrator privilege in start menu.
set CL=-FI"%VCINSTALLDIR%Tools\MSVC\14.11.25503\include\stdint.h"
pip install pycrypto
For ppl who is encountering same situation as mine:
Env
Steps
set CL=-FI"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.27.29110\include\stdint.h"
pip install pycrypto
in a cmd window(may need admin privilege)
1Use PyCryptodome instead of pycrypto. pycrypto is discontinued and is no longer actively supported. PyCryptodome exposes almost the same API as pycrypto (source).
Thanks to user1960422's answer.
PowerShell steps for pycrypto 2.6.1 (via simple-crypt) / Python 3.6 / Windows 10:
$env:VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"
$env:CL="-FI`"$env:VCINSTALLDIR\INCLUDE\stdint.h`""
Successful simple-crypt / pycrypto install
I also needed to follow the answer in: https://stackoverflow.com/a/24822876/8751739 to fix a winrandom
module error.