【问题标题】:Error installing PyCrypto on Mac 10.9.5在 Mac 10.9.5 上安装 PyCrypto 时出错
【发布时间】:2014-12-24 02:49:12
【问题描述】:

我正在尝试为 Python 3.4 安装 PyCrypto,但我遇到了 C 编译程序的问题。 它说“错误:无法运行 C 编译程序”。 有人知道如何解决吗??

代码:

running build
running build_py
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/briansabbath/Desktop/pycrypto-2.6.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Traceback (most recent call last):
  File "setup.py", line 456, in <module>
    core.setup(**kw)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build.py", line 126, in run
    self.run_command(cmd_name)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 251, in run
    self.run_command(cmd_name)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 278, in run
    raise RuntimeError("autoconf error")
RuntimeError: autoconf error

【问题讨论】:

  • 我尝试通过 home-brew 安装,但这是另一个问题,因为我在安装 homebrew 时遇到错误,并遵循其他不起作用的建议:(

标签: macos osx-yosemite python-3.4 pycrypto


【解决方案1】:

这可能表明你没有安装像 gcc 这样的 C 编译器。运行以下命令可能会有所帮助(命令行工具必须安装在 xcode 中):

xcode-select --install

【讨论】:

    【解决方案2】:

    对我有用的方法

    brew install pip
    sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pycrypto
    

    您可以在 virtualenv 中运行它。如果您有更好的方法,请在下方留言!

    【讨论】:

      猜你喜欢
      • 2016-02-26
      • 1970-01-01
      • 2016-02-25
      • 2023-03-30
      • 1970-01-01
      • 2014-11-19
      • 1970-01-01
      • 1970-01-01
      • 2015-03-30
      相关资源
      最近更新 更多