我有一个安装了python 3.7的Windows 7 Ultimate。 当我通过pip install pycrypto安装pycrypto时,看到以下错误:
PS C:\Windows\system32> pip install pycrypto
Collecting pycrypto
Using cached https://files.pythonhosted.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz
Installing collected packages: pycrypto
Running setup.py install for pycrypto: started
Running setup.py install for pycrypto: finished with status 'error'
Complete output from command c:\users\celik7\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='
C:\\Users\\celik7\\AppData\\Local\\Temp\\pip-install-lqxsh35j\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().rep
lace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\celik7\AppData\Local\Temp\pip-record-c5da1tqt\inst
all-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
....................
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\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDE
BUG /MD -Isrc/ -Isrc/inc-msvc/ -Ic:\users\celik7\appdata\local\programs\python\python37\include -Ic:\users\celik7\appdata\local\programs\python\
python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files
(x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\
um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared"
"-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\P
rogram Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /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.17134.0\ucrt\inttypes.h(27): error C2061: syntax error: identifier 'intmax_t'
................
pip.exe : Command "c:\users\celik7\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\cel
ik7\\AppData\\Local\\Temp\\pip-install-lqxsh35j\\pycrypto\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '
\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\celik7\AppData\Local\Temp\pip-record-c5da1tqt\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in C:\Users\celik7\AppData\Local\Temp\pip-install-lqxsh35j\pycrypto\
At line:1 char:4
+ pip <<<< install pycrypto
+ CategoryInfo : NotSpecified: (Command "c:\use...sh35j\pycrypto\:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\inttypes.h(64): error C2143: syntax error: missing '{' before '__cdecl'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\inttypes.h(70): error C2143: syntax error: missing '{' before '__cdecl'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\inttypes.h(77): error C2143: syntax error: missing '{' before '__cdecl'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\inttypes.h(83): error C2143: syntax error: missing '{' before '__cdecl'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\inttypes.h(90): error C2143: syntax error: missing '{' before '__cdecl'
C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\inttypes.h(96): error C2143: syntax error: missing '{' before '__cdecl'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe'
failed with exit status 2
///////////////////////////////////////////////// //////////// 我已经在Win 7上安装了: + Visual Studio Build Tools 2017(完全) + windows 8.1并赢得10 sdk
我该怎么做才能解决这个问题;