[Solution] Error when installing pycrypto on windows. error C2061: Syntax error: identifier 'intmax_t'

1. Execute the command and report an error

Copy code

pip install pycrypto

Installing collected packages: pycrypto
Running setup.py install for pycrypto ... error
ERROR: Command errored out with exit status 1

2. Download and install visual studio

https://visualstudio.microsoft.com/zh-hans/

 

3.Cause of error

C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(53): error C2059: Syntax error: ")" C:\Program Files ( 
x86)\Windows Kits\ 10\include\10.0.19041.0\ucrt\inttypes.h(55): error C2143: Syntax error: Missing '{' (before '__cdecl') 

Error in inttypes.h

4.Solution

1. Find the installation location of Visual Studio 2022, right-click and open the file location 

2. Go to the directory: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\include 

3. Find stdint.h 

4. Copy stdint.h to the path where Windows Kits error is reported: C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h(100): error C2143: Syntax Error: Missing "{" (in front of "__cdecl") in the C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt directory 5. Modify C:\Program Files (x86) 

\ Windows Kits\10\include\10.0.19041.0\ucrt\inttypes.h 

Change the angle brackets on line 14 to double quotes #include <stdint.h> --> #include "stdint.h"

5. The problem is solved and pycrypto can be installed normally.

Guess you like

Origin blog.csdn.net/ab6326795/article/details/131917782