【问题标题】:pip install gevent mountain lion failspip install gevent山狮失败
【发布时间】:2013-12-20 20:39:57
【问题描述】:

我在 Mountain Lion 上安装 gevent 时遇到问题。我实际上想安装 Deis 和 gevent 是必需的。

当我运行 pip install gevent 时,我得到了这个日志:

/usr/local/bin/pip run on Fri Dec 20 20:59:02 2013
Downloading/unpacking gevent

  Running setup.py egg_info for package gevent

    running egg_info
    writing requirements to pip-egg-info/gevent.egg-info/requires.txt
    writing pip-egg-info/gevent.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/gevent.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/gevent.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found


    reading manifest file 'pip-egg-info/gevent.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'pip-egg-info/gevent.egg-info/SOURCES.txt'
  Source in /var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent has version 1.0, which satisfies requirement gevent
Requirement already satisfied (use --upgrade to upgrade): greenlet in /usr/local/lib/python2.7/site-packages (from gevent)

Installing collected packages: gevent

  Running setup.py install for gevent

    Running command /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-zNHFhT-record/install-record.txt --single-version-externally-managed
    running install
    running build
    running build_py
    running build_ext
    /private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/libev/configure: line 9034: /usr/bin/awk: cannot execute binary file

    LLVM ERROR: IO failure on output stream.

    /private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/libev/configure: line 9094: /usr/bin/awk: cannot execute binary file

    /bin/echo: write: Broken pipe

    ./config.status: line 1212: /usr/bin/awk: cannot execute binary file

    sed: stdout: Broken pipe

    config.status: error: could not create Makefile

    Running '/bin/sh /private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/libev/configure > configure-output.txt' in /private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/build/temp.macosx-10.7-x86_64-2.7/libev

    building 'gevent.core' extension

    /usr/bin/llvm-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I /usr/local/Cellar/libevent/2.0.21/include -L /usr/local/Cellar/libevent/2.0.21/lib -U__llvm__ -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.macosx-10.7-x86_64-2.7/libev -Ilibev -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/gevent.core.c -o build/temp.macosx-10.7-x86_64-2.7/gevent/gevent.core.o

    In file included from gevent/libev.h:2,

                     from gevent/gevent.core.c:302:

    libev/ev.c:45:22: error: config.h: No such file or directory

    libev/ev.c:467:48: warning: "/*" within comment

    In file included from gevent/libev.h:2,

                     from gevent/gevent.core.c:302:

    libev/ev.c:1311: warning: 'ev_default_loop_ptr' initialized and declared 'extern'

    In file included from gevent/libev.h:2,

                     from gevent/gevent.core.c:302:

    libev/ev.c: In function 'ev_io_start':

    libev/ev.c:3332: warning: suggest parentheses around arithmetic in operand of |

    libev/ev.c:4563:27: warning: "/*" within comment

    libev/ev.c:4564:27: warning: "/*" within comment

    error: command '/usr/bin/llvm-gcc' failed with exit status 1

    Complete output from command /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-zNHFhT-record/install-record.txt --single-version-externally-managed:

    running install

running build

running build_py

running build_ext

/private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/libev/configure: line 9034: /usr/bin/awk: cannot execute binary file

LLVM ERROR: IO failure on output stream.

/private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/libev/configure: line 9094: /usr/bin/awk: cannot execute binary file

/bin/echo: write: Broken pipe

./config.status: line 1212: /usr/bin/awk: cannot execute binary file

sed: stdout: Broken pipe

config.status: error: could not create Makefile

Running '/bin/sh /private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/libev/configure > configure-output.txt' in /private/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/build/temp.macosx-10.7-x86_64-2.7/libev

building 'gevent.core' extension

/usr/bin/llvm-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I /usr/local/Cellar/libevent/2.0.21/include -L /usr/local/Cellar/libevent/2.0.21/lib -U__llvm__ -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.macosx-10.7-x86_64-2.7/libev -Ilibev -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/gevent.core.c -o build/temp.macosx-10.7-x86_64-2.7/gevent/gevent.core.o

In file included from gevent/libev.h:2,

                 from gevent/gevent.core.c:302:

libev/ev.c:45:22: error: config.h: No such file or directory

libev/ev.c:467:48: warning: "/*" within comment

In file included from gevent/libev.h:2,

                 from gevent/gevent.core.c:302:

libev/ev.c:1311: warning: 'ev_default_loop_ptr' initialized and declared 'extern'

In file included from gevent/libev.h:2,

                 from gevent/gevent.core.c:302:

libev/ev.c: In function 'ev_io_start':

libev/ev.c:3332: warning: suggest parentheses around arithmetic in operand of |

libev/ev.c:4563:27: warning: "/*" within comment

libev/ev.c:4564:27: warning: "/*" within comment

error: command '/usr/bin/llvm-gcc' failed with exit status 1

----------------------------------------

Command /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-zNHFhT-record/install-record.txt --single-version-externally-managed failed with error code 1 in /var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent

Exception information:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
    status = self.run(options, args)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 261, in run
    requirement_set.install(install_options, global_options)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1166, in install
    requirement.install(install_options, global_options)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 589, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg/pip/util.py", line 612, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-zNHFhT-record/install-record.txt --single-version-externally-managed failed with error code 1 in /var/folders/1g/4kj51dlj7z58774p9nlby2c00000gn/T/pip-build/gevent
➜  deis git:(master)

此错误的原因可能是什么,我该如何解决?还有其他安装gevent的方法吗?

【问题讨论】:

  • 您的/usr/bin/awk 存在和/或工作吗?
  • 它存在 ➜ deis git:(master) ll /usr/bin/awk -rwxr-xr-x 1 root wheel 115968 Jun 20 2013 /usr/bin/awk 但它不起作用:➜ deis git:(master) /usr/bin/awk zsh: exec format error: /usr/bin/awk
  • 也许尝试重新安装它?你是从 brew 那里得到的吗?
  • 谢谢!删除 awk,从 Homebrew 安装它,将 Homebrew awk 符号链接到 /usr/bin/awk 并解决 brew doctor 提出的警告后,我解决了这个问题。

标签: python macos osx-mountain-lion gevent deis


【解决方案1】:

您似乎使用Homebrew 安装了Python,并且您的某些系统二进制文件(或至少您的PATH 环境变量)出了点问题。

最好的解决方案是修复brew doctor 输出的警告。这将确保您酿造的 pip 能够正常工作(以及其他酿造的东西)。

我在 Mountain Lion 上,使用的是 Python,我刚刚使用 pip install Deis 成功安装了 Deis。有一堆编译器警告,但似乎已正确安装。

【讨论】:

  • 感谢您培养 brew doctor!这是一个非常有用的工具。
猜你喜欢
  • 1970-01-01
  • 2012-08-16
  • 1970-01-01
  • 2012-09-16
  • 2015-12-22
  • 2012-09-24
  • 2018-10-11
  • 2015-05-05
  • 2021-03-16
相关资源
最近更新 更多