Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Error in Windows7 Python-3.6 installation PyCrypto (pycrypto 2.6.1) and its solution

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Today, I'm going to install a pycrypto 2.6.1 module based on python3.6 on the Windows system, and unfortunately I reported a bunch of errors, as follows:

Running install

Running build

Running build_py

Running build_ext

Warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

Building 'Crypto.Random.OSRNG.winrandom' extension

C:\ Program Files (x86)\ Microsoft Visual Studio 14.0\ VC\ BIN\ x86_amd64\ cl.exe / c / nologo / Ox / W3 / GL / DNDEBUG / MD-Isrc/-Isrc/inc-msvc/-IC:\ Python36\ include-IC:\ Python36\ include

Winrand.c

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (26): error C2061: syntax error: identifier 'intmax_t'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (27): error C2061: syntax error: identifier 'rem'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (27): error C2059: syntax error:';'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (28): error C2059: syntax error:'}'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (30): error C2061: syntax error: identifier 'imaxdiv_t'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (30): error C2059: syntax error:';'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (40): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (41): error C2146: syntax error: missing') 'before identifier' _ Number'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (41): error C2061: syntax error: identifier'_ Number'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (41): error C2059: syntax error:';'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (42): error C2059: syntax error:')'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (45): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (46): error C2146: syntax error: missing') 'before identifier' _ Numerator'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (46): error C2061: syntax error: identifier'_ Numerator'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (46): error C2059: syntax error:';'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (46): error C2059: syntax error:','

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (48): error C2059: syntax error:')'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (50): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (56): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (63): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (69): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (76): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (82): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (89): error C2143: syntax error: missing'{'before' _ _ cdecl'

C:\ Program Files (x86)\ Windows Kits\ 10\ include\ 10.0.10240.0\ ucrt\ inttypes.h (95): error C2143: syntax error: missing'{'before' _ _ cdecl'

Error: command'C:\\ Program Files (x86)\\ Microsoft Visual Studio 14.0\\ VC\\ BIN\\ x86_amd64\\ cl.exe' failed with exit status 2

After a period of Baidu and Google and an attempt to install pycrypto 2.6.1 successfully, the specific solutions are as follows:

Set the environment variable for Microsoft Visual Studio 14.0, as shown in the figure:

Open cmd and execute the following command: set CL=/FI "% VCINSTALLDIR%\\ INCLUDE\\ stdint.h"% CL%

Reinstall pycrypto 2.6.1

Enter the pycrypto 2.6.1 directory through cmd and execute python setup.py install

The results are as follows:

Pycrypto 2.6.1 was successfully installed.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report