win10 Microsoft Visual C++ 14.0 is required and cl.exe failed with exit status 2

文章目录

    • 问题1: error: Microsoft Visual C++ 14.0 is required
    • 问题2: cl.exe failed with exit status 2
      • 2.1 手动下载pycrypto
      • 2.2 安装问题
      • 2.3 解决问题
    • 参考文档:

问题1: error: Microsoft Visual C++ 14.0 is required

The Solution is:
1.Go to Build Tools for Visual Studio 2017
2. Select free download under Visual Studio Community 2017. This will download the installer. Run the installer.
3.Select what you need under workload tab:

	a. Under Windows, there are 3 choices. Only check Desktop development with C++
	b. Under Web & Cloud, there are 7 choices. Only check Python development (I believe this is optional But I have done it).

4.In cmd, type pip3 install misaka enter image description here
win10 Microsoft Visual C++ 14.0 is required and cl.exe failed with exit status 2_第1张图片
Note if you already installed Visual Studio then when you run the installer, you can modify yours (click modify button under Visual Studio Community 2017) and do steps 3 and 4
win10 Microsoft Visual C++ 14.0 is required and cl.exe failed with exit status 2_第2张图片

Final Note : If you don’t want to install all modules, having the 3 ones below (or a newer version of the VC++ 2017) would be sufficient. (you can also install the Visual Studio Build Tools with only these options so you dont need to install Visual Studio Community Edition itself) => This minimal install is already a 4.5GB, so saving off anything is helpful The modules you need for c++ compiler
win10 Microsoft Visual C++ 14.0 is required and cl.exe failed with exit status 2_第3张图片

安装完成,最好重启终端甚至重启电脑。

问题2: cl.exe failed with exit status 2

pip install ansible==2.2.1 安装依赖包pycrypto的时候出问题。
尝试手动安装:下载安装包,解压,利用python setup.py install 安装源码包

2.1 手动下载pycrypto

https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz

2.2 安装问题

PS C:\Users\Downloads\pycrypto-2.7a1\pycrypto-2.7a1> python.exe .\setup.py install
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\Crypto
copying lib\Crypto\pct_warnings.py -> build\lib.win-amd64-3.7\Crypto
copying lib\Crypto\__init__.py -> build\lib.win-amd64-3.7\Crypto
creating build\lib.win-amd64-3.7\Crypto\Hash
copying lib\Crypto\Hash\CMAC.py -> build\lib.win-amd64-3.7\Crypto\Hash
copying lib\Crypto\Hash\HMAC.py -> build\lib.win-amd64-3.7\Crypto\Hash
copying lib\Crypto\Hash\MD5.py -> build\lib.win-amd64-3.7\Crypto\Hash
copying lib\Crypto\Hash\RIPEMD.py -> build\lib.win-amd64-3.7\Crypto\Hash
copying lib\Crypto\Hash\SHA.py -> build\lib.win-amd64-3.7\Crypto\Hash
copying lib\Crypto\Hash\SHA1.py -> build\lib.win-amd64-3.7\Crypto\Hash
copying lib\Crypto\Hash\__init__.py -> build\lib.win-amd64-3.7\Crypto\Hash
creating build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\AES.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\ARC2.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\ARC4.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\blockalgo.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\Blowfish.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\CAST.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\DES.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\DES3.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_OAEP.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\PKCS1_v1_5.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\XOR.py -> build\lib.win-amd64-3.7\Crypto\Cipher
copying lib\Crypto\Cipher\__init__.py -> build\lib.win-amd64-3.7\Crypto\Cipher
creating build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\asn1.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\Counter.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\number.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\Padding.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\py3compat.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\randpool.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\RFC1751.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\winrandom.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\_number_new.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\_time.py -> build\lib.win-amd64-3.7\Crypto\Util
copying lib\Crypto\Util\__init__.py -> build\lib.win-amd64-3.7\Crypto\Util
creating build\lib.win-amd64-3.7\Crypto\Random
copying lib\Crypto\Random\random.py -> build\lib.win-amd64-3.7\Crypto\Random
copying lib\Crypto\Random\_UserFriendlyRNG.py -> build\lib.win-amd64-3.7\Crypto\Random
copying lib\Crypto\Random\__init__.py -> build\lib.win-amd64-3.7\Crypto\Random
creating build\lib.win-amd64-3.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaAccumulator.py -> build\lib.win-amd64-3.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaGenerator.py -> build\lib.win-amd64-3.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\SHAd256.py -> build\lib.win-amd64-3.7\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\__init__.py -> build\lib.win-amd64-3.7\Crypto\Random\Fortuna
creating build\lib.win-amd64-3.7\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\fallback.py -> build\lib.win-amd64-3.7\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\nt.py -> build\lib.win-amd64-3.7\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\posix.py -> build\lib.win-amd64-3.7\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\rng_base.py -> build\lib.win-amd64-3.7\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\__init__.py -> build\lib.win-amd64-3.7\Crypto\Random\OSRNG
creating build\lib.win-amd64-3.7\Crypto\SelfTest
copying lib\Crypto\SelfTest\st_common.py -> build\lib.win-amd64-3.7\Crypto\SelfTest
copying lib\Crypto\SelfTest\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\common.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_AES.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC2.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_ARC4.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_Blowfish.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_CAST.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_DES3.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_15.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_pkcs1_oaep.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\test_XOR.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
copying lib\Crypto\SelfTest\Cipher\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Cipher
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\common.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_CMAC.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_HMAC.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD2.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD4.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_MD5.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_RIPEMD160.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA1.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA224.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA256.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA384.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\test_SHA512.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
copying lib\Crypto\SelfTest\Hash\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Hash
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_AllOrNothing.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_chaffing.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_KDF.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\test_rfc1751.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Protocol
copying lib\Crypto\SelfTest\Protocol\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Protocol
creating build\lib.win-amd64-3.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_DSA.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_ElGamal.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_import_DSA.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_import_RSA.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\test_RSA.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\PublicKey
copying lib\Crypto\SelfTest\PublicKey\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\PublicKey
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_random.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test_rpoolcompat.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\test__UserFriendlyRNG.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random
copying lib\Crypto\SelfTest\Random\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaAccumulator.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaGenerator.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\test_SHAd256.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\Fortuna
copying lib\Crypto\SelfTest\Random\Fortuna\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\Fortuna
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_fallback.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_generic.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_nt.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_posix.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\test_winrandom.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\OSRNG
copying lib\Crypto\SelfTest\Random\OSRNG\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Random\OSRNG
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_asn1.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_Counter.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_number.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_Padding.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\test_winrandom.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Util
copying lib\Crypto\SelfTest\Util\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Util
creating build\lib.win-amd64-3.7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_15.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\test_pkcs1_pss.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Signature
copying lib\Crypto\SelfTest\Signature\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\Signature
creating build\lib.win-amd64-3.7\Crypto\SelfTest\IO
copying lib\Crypto\SelfTest\IO\test_PKCS8.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\IO
copying lib\Crypto\SelfTest\IO\__init__.py -> build\lib.win-amd64-3.7\Crypto\SelfTest\IO
creating build\lib.win-amd64-3.7\Crypto\Protocol
copying lib\Crypto\Protocol\AllOrNothing.py -> build\lib.win-amd64-3.7\Crypto\Protocol
copying lib\Crypto\Protocol\Chaffing.py -> build\lib.win-amd64-3.7\Crypto\Protocol
copying lib\Crypto\Protocol\KDF.py -> build\lib.win-amd64-3.7\Crypto\Protocol
copying lib\Crypto\Protocol\__init__.py -> build\lib.win-amd64-3.7\Crypto\Protocol
creating build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\DSA.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\ElGamal.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\pubkey.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\RSA.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_DSA.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_RSA.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\_slowmath.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
copying lib\Crypto\PublicKey\__init__.py -> build\lib.win-amd64-3.7\Crypto\PublicKey
creating build\lib.win-amd64-3.7\Crypto\Signature
copying lib\Crypto\Signature\PKCS1_PSS.py -> build\lib.win-amd64-3.7\Crypto\Signature
copying lib\Crypto\Signature\PKCS1_v1_5.py -> build\lib.win-amd64-3.7\Crypto\Signature
copying lib\Crypto\Signature\__init__.py -> build\lib.win-amd64-3.7\Crypto\Signature
creating build\lib.win-amd64-3.7\Crypto\IO
copying lib\Crypto\IO\PEM.py -> build\lib.win-amd64-3.7\Crypto\IO
copying lib\Crypto\IO\PKCS8.py -> build\lib.win-amd64-3.7\Crypto\IO
copying lib\Crypto\IO\_PBES.py -> build\lib.win-amd64-3.7\Crypto\IO
copying lib\Crypto\IO\__init__.py -> build\lib.win-amd64-3.7\Crypto\IO
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Random.OSRNG.winrandom' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
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:\Python37\include -IC:\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" /Tcsrc/winrand.c /Fobuild\temp.win-amd64-3.7\Release\src/winrand.obj
winrand.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(27): error C2061: 语法错误: 标识符“intmax_t”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(28): error C2061: 语法错误: 标识符“rem”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(28): error C2059: 语法错误:“;”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(29): error C2059: 语法错误:“}”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(31): error C2061: 语法错误: 标识符“imaxdiv_t”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(31): error C2059: 语法错误:“;”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(41): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(42): error C2146: 语法错误: 缺少“)”(在标识符“_Number”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(42): error C2061: 语法错误: 标识符“_Number ”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(42): error C2059: 语法错误:“;”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(43): error C2059: 语法错误:“)”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(46): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(47): error C2146: 语法错误: 缺少“)”(在标识符“_Numerator”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(47): error C2061: 语法错误: 标识符“_Numerator”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(47): error C2059: 语法错误:“;”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(47): error C2059: 语法错误:“,”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(49): error C2059: 语法错误:“)”
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(51): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(57): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(64): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(70): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(77): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(83): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(90): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\inttypes.h(96): error C2143: 语法错误: 缺少“{”(在“__cdecl”的前面)
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

win10 Microsoft Visual C++ 14.0 is required and cl.exe failed with exit status 2_第4张图片

2.3 解决问题

解压完成 比如 在C:\Downloads\pycrypto-2.6.1\pycrypto-2.6.1
修改文件 setup.py

   def detect_modules (self):
        # Read the config.h file (usually generated by autoconf)
        if self.compiler.compiler_type == 'msvc' and False:
            # Add special include directory for MSVC (because MSVC is special)
            self.compiler.include_dirs.insert(0, "src/inc-msvc/")
            ac = self.__read_autoconf("src/config.h")
        else:
            ac = self.__read_autoconf("src/config.h")

复制文件 C:\Users\wangjin\Downloads\pycrypto-2.6.1\pycrypto-2.6.1\src\inc-msvc\config.h
到C:\Users\wangjin\Downloads\pycrypto-2.6.1\pycrypto-2.6.1\src\下面
再安装
PS C:\Users\Downloads\pycrypto-2.6.1\pycrypto-2.6.1> python .\setup.py install

参考文档:

https://blog.csdn.net/WangZuoChuan/article/details/81287605
https://stackoverflow.com/questions/29846087/microsoft-visual-c-14-0-is-required-unable-to-find-vcvarsall-bat

你可能感兴趣的:(python)