谷歌搜索后,我发现大多数答案都说:安装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
中的窗口的预构建二进制文件安装pycrypto答案 0 :(得分:1)
vcvarsall.bat
文件包含为您的计算机选择适当的Microsoft C编译器的说明。由于您没有该文件,因此您已正确尝试安装并使用其他编译器MinGW。
您唯一缺少的步骤是将MinGW编译器的位置添加到PATH环境变量中。有关详细说明,请参阅以下问题的已接受答案:How do I add the MinGW bin directory to my system path?