0

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?

6
  • When I am having problems like this.. I use WSL. Works every time and you will be able use Linux help to solve your problem and not have to fight windows ports or less documentation. Commented Mar 20, 2020 at 20:59
  • Can I install the package in WSL and use them in Windows directly?
    – Tharrry
    Commented Mar 21, 2020 at 16:25
  • "Use them in windows directly.." I am not sure what you mean.. but I think the answer would be yes. I can pipe information from cmd.exe, into bash, sort it (or whatever), then into powershell.exe to do something else with it.. seamlessly. Play with it..;) you will see. Commented Mar 21, 2020 at 21:20
  • True, my comment was a bit ambiguous. I need a way to be able to import the package in a python script under windows. Meaning I need the compiled library available on windows.
    – Tharrry
    Commented Mar 22, 2020 at 10:50
  • OH.. no, you could not use WSL Linux Python with a windows dynamic library.. Sorry.. I gotz nothing for you Harri. Good luck! :) Commented Mar 23, 2020 at 3:00

1 Answer 1

2

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

  1. Go to the vsvars*.bat location

    cd C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build

  2. Run vsvars*.bat depending on VC version and architecture

    vcvars64.bat

  3. 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"

  4. Install pycrypto again

    pip install pycrypto

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .