This is a traight up copy of my question from here.
I got a comment recommending posting it here as well since it is more of an environment thing.
I need to install pycrypto for a project that requires pycrypto. PyCryptodome is not an option, sadly.
I have tried what everybody seems to recommend, aka powershell commands proposed here but to no avail.
I set VCINSTALLDIR in my user vars to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\. I double checked that stdint.h is indeed at VCINSTALLDOR\Tool\MSVC\14.14.26428\include\. I then ran
set CL=-FI"%VCINSTALLDOR%Tool\MSVC\14.14.26428\include\stdint.h"
and
pip install pycrypto
still no luck. Tried it both with and without admin privileges.
Am I missing something?
61 Answer
Edit: It's easier to use pycryptodome, that has the same name when you use it. From here
pip uninstall crypto pip uninstall pycrypto pip install pycryptodome For the installation of vstools (Microsoft Visual C++ 14.0) I used this answer
Now be sure that you had located acuratelly the next 2 paths (Mine below):
vcvars*.bat (choose file name depending on VC version and architecture): C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build
stdint.h: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include
In a command shell
Go to the vsvars*.bat location
cd C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build
Run vsvars*.bat depending on VC version and architecture
vcvars64.bat
Set the stdint.h location, without close the shell
set CL=-FI"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include\stdint.h"
Install pycrypto again
pip install pycrypto