谷歌搜索后,我发现大多数答案都是:安装 mingw,然后使用“setup.py install build --compiler=mingw32”进行安装。这就是我得到的:
C:\Users\Joe\Desktop\pycrypto-2.6>setup.py install build --compiler=mingw32
running install
running build
running build_py
running build_ext
running build_configure
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/cygdrive/c/Users/Joe/Desktop/pycrypto-2.6':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Traceback (most recent call last):
File "C:\Users\Joe\Desktop\pycrypto-2.6\setup.py", line 456, in <module>
core.setup(**kw)
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Joe\Desktop\pycrypto-2.6\setup.py", line 251, in run
self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Joe\Desktop\pycrypto-2.6\setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
我还尝试使用来自 www.voidspace.org.uk 的 Windows 预构建二进制文件安装pycrypto