gpt4 book ai didi

python - 在 Lion 上为 python 安装 twisted 失败

转载 作者:行者123 更新时间:2023-11-28 20:26:33 26 4
gpt4 key购买 nike

我想在我的 macbook 上安装 twisted。

System version: Mac OS X Lion 10.7.4
Xcode version: Version 4.3.3 (4E3002)

Python 版本:

Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

当我运行这个时:

sudo easy_install twisted

它失败了:

Processing Twisted-12.1.0.tar.bz2

Running Twisted-12.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_installdtZ7Lk/Twisted-12.1.0/egg-dist-tmp-NUWexg

unable to execute gcc-4.2: No such file or directory

...

error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1

但我确实安装了 gcc:

gcc --version 

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)

Copyright (C) 2007 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

谁能帮帮我?

发布:由此解决的问题:

which gcc
/usr/bin/gcc
cd /usr/bin
ln gcc gcc-4.2

最佳答案

  1. Twisted 是 OS X 自带的,所以你不需要这样做;假设 11.0 是一个可接受的版本(这就是 Lion 中的版本)。只需 >>> import twisted 即可。

  2. 永远,永远不要在任何平台上sudo easy_install 任何东西,也许,virtualenv 除外。或 pip . easy_install 没有卸载功能,也无法为您提供已安装文件的列表。 pip install 稍微好一些,但最好避免在全局系统中安装任何东西;系统本身的组件可能会使用某些 Python 库,安装新版本可能无法完全兼容。

关于python - 在 Lion 上为 python 安装 twisted 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11365085/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com