If you are on Windows, using Python 3, you may face some issues when trying to install the outdated and no-longer-maintained
Here’s how you can fix this. You will need to have Microsoft Visual Studio 14.0, which by default is located at the following path
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC. You will also need Visual Studio Toolkit 10, which by default is located at
C:\Program Files (x86)\Windows Kits\10.
You can install both of them by just installing Visual Studio 2019 C/C++, or specifically the Visual Studio 2019 Build Tools. After you ensure that you have both of them, do the following
- In your environment variables, create a new entry name=
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC. Take note that you should create them as a User variable, rather than a System variable.
- Save the environment variable
- Open cmd, enter the following
set CL=/FI"%VCINSTALLDIR%\INCLUDE\stdint.h" %CL%
- Now, you can try to run
pip install pycryptoagain and see if you get any error. If you do, it likely shows a line like this
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(31): error C2061: syntax error: identifier 'intmax_t', along with an
exit status 2somewhere in the logs.
To fix the above error, do the following
- Go to
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrtand in the file
inttypes.h, add the following lines of code and save.
#define intmax_t long long
#define uintmax_t unsigned long long
pip install pycryptoagain.
- After successfully installing
pycrypto, you might want to go back and remove those 2 lines of code from
That’s it !