PyCrypto Refuses To Install

Discussion in 'Computer Software and Operating Systems' started by gudenau, Jan 4, 2017.

  1. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,175
    1,194
    Jul 7, 2010
    United States
    /dev/random
    I have been trying to install PyCrypto for the entire day, but failing.

    pip install pycrypto fails with this:
    Code:
        winrand.c
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(28): error C2061: syntax error: identifier 'intmax_t'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(29): error C2061: syntax error: identifier 'rem'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(29): error C2059: syntax error: ';'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(30): error C2059: syntax error: '}'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(32): error C2061: syntax error: identifier 'imaxdiv_t'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(32): error C2059: syntax error: ';'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(42): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(43): error C2146: syntax error: missing ')' before identifier '_Number'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(43): error C2061: syntax error: identifier '_Number'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(43): error C2059: syntax error: ';'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(44): error C2059: syntax error: ')'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(47): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(48): error C2146: syntax error: missing ')' before identifier '_Numerator'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(48): error C2061: syntax error: identifier '_Numerator'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(48): error C2059: syntax error: ';'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(48): error C2059: syntax error: ','
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(50): error C2059: syntax error: ')'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(52): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(58): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(65): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(71): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(78): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(84): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(91): error C2143: syntax error: missing '{' before '__cdecl'
        C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\ucrt\inttypes.h(97): error C2143: syntax error: missing '{' before '__cdecl'
        error: command 'D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
    Any idea how to fix this?
     
  2. Joom

    Joom  ❤❤❤

    Member
    3,489
    2,347
    Jan 8, 2016
    United States
    What version of Python are you using, and why is it trying to read from D:?
     
  3. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,175
    1,194
    Jul 7, 2010
    United States
    /dev/random
    3.6, because it is my HDD.
     
  4. Joom

    Joom  ❤❤❤

    Member
    3,489
    2,347
    Jan 8, 2016
    United States
    So you have two Program Files directories on two different hard drives/partitions? Meh, anyway, try using 2.7.2.
     
  5. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,175
    1,194
    Jul 7, 2010
    United States
    /dev/random
    I do not want to downgrade for pyCrypto, I can shell out for openSSL for now.
     
  6. Joom

    Joom  ❤❤❤

    Member
    3,489
    2,347
    Jan 8, 2016
    United States
    You don't have to "downgrade". You can have multiple versions of Python installed. You just call it with python2 or whatever the Windows equivalent is.
    Code:
    python2 pip install pycrypto
     
  7. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,175
    1,194
    Jul 7, 2010
    United States
    /dev/random
    The Windows version is python, two installs can not easily coexist.
     
  8. Joom

    Joom  ❤❤❤

    Member
    3,489
    2,347
    Jan 8, 2016
    United States
    Yes they can. You just have to make sure your PATH directive stays consistent. This applies to all operating systems, not just Windows. Python versions install themselves to their own directories, and create a unique PATH directive for each installation, so it really isn't anything more than a ten second hassle to update your PATH.
     
  9. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,175
    1,194
    Jul 7, 2010
    United States
    /dev/random
    Except for the part where they are all python.exe.
     
  10. Joom

    Joom  ❤❤❤

    Member
    3,489
    2,347
    Jan 8, 2016
    United States
    They're not. Each Python executable is appended with their version number (python27.exe, python36.exe, etc.), and your PATH is what makes it possible to call it as just "python". By doing so though, you're calling the latest version that's installed (until you change your PATH). This is why you have to specify the version either in the command or the script you're using.
     
  11. MarcusD

    MarcusD F00FCACE addict

    Member
    1,062
    1,981
    Oct 16, 2015
    Hungary
    /media/marcus/WESTERNDIGI
    I don't see python27/python35 either :/

    screenshot

    Why is it using MSVC? :/ I think it would be a better idea to compile with gcc. Google how to switch your default PyDist compiler to MinGW
     
    Last edited by MarcusD, Jan 5, 2017
  12. Joom

    Joom  ❤❤❤

    Member
    3,489
    2,347
    Jan 8, 2016
    United States
    Oh ok, they changed it on Windows. Regardless, your PATH can be modified to specify Python 2 and 3's locations respectively. This will allow you to call them as either python2 or python3 (or whatever you set in your PATH).
     
  13. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,175
    1,194
    Jul 7, 2010
    United States
    /dev/random
    I still do not understand how that would work, the PATH is only "look here for executables", has nothing to do with the name of the executable.
     
  14. Joom

    Joom  ❤❤❤

    Member
    3,489
    2,347
    Jan 8, 2016
    United States