2

谷歌搜索后,我发现大多数答案都是:安装 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

4

1 回答 1

1

vcvarsall.bat文件包含为您的机器选择合适的 Microsoft C 编译器的说明。由于您没有该文件,因此您已正确尝试安装和使用另一个编译器 MinGW。

您缺少的唯一步骤是将 MinGW 编译器的位置添加到您的 PATH 环境变量中。请参阅以下问题的已接受答案以获取详细说明:如何将 MinGW bin 目录添加到我的系统路径?

于 2012-11-26T19:43:53.780 回答