PyCrypto Refuses To Install

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

Jan 4, 2017
  1. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,095
    Location:
    /dev/random
    Country:
    United States
    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

    Member Joom  ❤❤❤

    Joined:
    Jan 8, 2016
    Messages:
    2,892
    Country:
    United States
    What version of Python are you using, and why is it trying to read from D:?
     
  3. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,095
    Location:
    /dev/random
    Country:
    United States
    3.6, because it is my HDD.
     
  4. Joom

    Member Joom  ❤❤❤

    Joined:
    Jan 8, 2016
    Messages:
    2,892
    Country:
    United States
    So you have two Program Files directories on two different hard drives/partitions? Meh, anyway, try using 2.7.2.
     
  5. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,095
    Location:
    /dev/random
    Country:
    United States
    I do not want to downgrade for pyCrypto, I can shell out for openSSL for now.
     
  6. Joom

    Member Joom  ❤❤❤

    Joined:
    Jan 8, 2016
    Messages:
    2,892
    Country:
    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. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,095
    Location:
    /dev/random
    Country:
    United States
    The Windows version is python, two installs can not easily coexist.
     
  8. Joom

    Member Joom  ❤❤❤

    Joined:
    Jan 8, 2016
    Messages:
    2,892
    Country:
    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. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,095
    Location:
    /dev/random
    Country:
    United States
    Except for the part where they are all python.exe.
     
  10. Joom

    Member Joom  ❤❤❤

    Joined:
    Jan 8, 2016
    Messages:
    2,892
    Country:
    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

    Member MarcusD <on hiatus>

    Joined:
    Oct 16, 2015
    Messages:
    928
    Location:
    not 'Murica
    Country:
    Hungary
    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

    Member Joom  ❤❤❤

    Joined:
    Jan 8, 2016
    Messages:
    2,892
    Country:
    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. gudenaurock
    OP

    Member gudenaurock Never a unique idea

    Joined:
    Jul 7, 2010
    Messages:
    3,095
    Location:
    /dev/random
    Country:
    United States
    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

    Member Joom  ❤❤❤

    Joined:
    Jan 8, 2016
    Messages:
    2,892
    Country:
    United States

Share This Page