gpt4 book ai didi

python - 段错误 : 11 in OS X

转载 作者:IT老高 更新时间:2023-10-28 21:44:53 26 4
gpt4 key购买 nike

我在 OSX 10.9 上的 Python 3.3.2 中遇到问题,如果我在终端窗口中打开 Python,无论这两个命令是什么,它都会在我输入的第二行之后以“段错误:11”退出。例如,如果我输入:

>>> for x in range(1000): print(x)

效果很好,但如果我输入:

>>> for x in range(1000):
... print(x)

然后当我在第二行按 enter 时出现错误。我也可以毫无问题地运行超过 2 行的脚本。

我今天下午更新到 OSX 10.9,所以我怀疑可能是这样。

但是,我最近刚刚安装了 IPython(以及其他几个软件包)并且在过去几天一直在使用它,所以它可能是我最近安装的其他东西。我在运行 configure.py 的地方安装 PyQt 有几次不成功的尝试,但随后“make”命令失败,我也对此表示怀疑。

我尝试重新安装 Python,但没有解决问题。 IPython 和 IDLE 都可以正常工作。我只是担心潜在的问题。

最佳答案

这是 python 中 readline 兼容性中的一个错误,与 OSX10.9 中引入的更改有关。本周末,发布了 Python2.7.6 和 Python3.3.3 的候选版本,修复了这个错误。下载链接如下。

http://python.org/download/releases/2.7.6/

http://python.org/download/releases/3.3.3/

这就是问题,引自 Ned Deily,写在 python-dev email list 上.

On Tuesday, Apple released OS X 10.9 (a.k.a. Mavericks). There has already been a lot of interest in it, in part because Apple has made it available for free and has made it easy for users with 10.8, 10.7, and (most) 10.6 systems to upgrade directly to 10.9. Unfortunately, there are issues with our current maintenance releases (3.3.2 and 2.7.5) on OS X 10.9 that call for new maintenance releases as soon as possible.

One is critical in that it causes the interpreter to crash when running in interactive mode (http://bugs.python.org/issue18458). The problem was due to a long-standing compatibility issue in libedit's readline compatibility layer that upstream has finally fixed and Apple has now shipped in 10.9. Because the python.org installers dynamically link to libedit, the original workaround in readline.c for the original design flaw in history indexing now causes a segfault on 10.9 when the user types in the second command interactively. Not good. Ronald devised a fix that allows readline.so at runtime to detect and work with either version of libedit so that we continue to have binary compatibility across multiple OS X releases. That fix is already out in the 3.4.0 alphas and backported to the 3.3 and 2.7 branches, awaiting release there. Just in the last 12 hours, there have been at least four duplicates of the issue reported by users. I've updated the original issue to explicitly mention 10.9, now that it is no longer under NDA, and to provide a downloadable script for inexperienced users to workaround the problem by "removing" readline.so. Presumably, as word gets out, there will be fewer duplicate issues opened but the impact will remain.

关于python - 段错误 : 11 in OS X,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19531969/

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