gpt4 book ai didi

python - osx 上 python 2.7.4 的连接出现段错误 - 正确的行为还是错误?

转载 作者:太空宇宙 更新时间:2023-11-03 18:42:55 25 4
gpt4 key购买 nike

我遇到以下情况:

$ python
Python 2.7.4 (v2.7.4:026ee0057e2d, Apr 6 2013, 11:43:10)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ','.join(['1','2','3']
...
...
... )
Segmentation fault: 11

$ python
Python 2.7.4 (v2.7.4:026ee0057e2d, Apr 6 2013, 11:43:10)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ','.join(['1','2','3'])
'1,2,3'
>>> ','.join(['1','2','3']
Segmentation fault: 11

$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python

这对我来说看起来像是一个解释器错误,对吗?

<小时/>

(我的直觉告诉我应该得到一个

SyntaxError: unexpected EOF while parsing

)

最佳答案

FWIW;这是我对小牛队的设置。如您所见,我的所有二进制文件都在 /System/Library/... 中,而不是 /Library/... 中。如果有的话,请尝试直接运行其中之一。

有多种方法可以选择您当前的 Python 版本(python-config,另请参阅 man python),也许您干扰了这些?

pu@pumbair: ~  which python
/usr/bin/python
pu@pumbair: ~ v /usr/bin/pytho*
-rwxr-xr-x 2 root wheel 57K 27 Oct 20:28 /usr/bin/python
-rwxr-xr-x 5 root wheel 925B 27 Oct 20:28 /usr/bin/python-config
lrwxr-xr-x 1 root wheel 75B 27 Oct 20:28 /usr/bin/python2.5 -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5
lrwxr-xr-x 1 root wheel 82B 27 Oct 20:28 /usr/bin/python2.5-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5-config
lrwxr-xr-x 1 root wheel 75B 27 Oct 20:28 /usr/bin/python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
lrwxr-xr-x 1 root wheel 82B 27 Oct 20:28 /usr/bin/python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
lrwxr-xr-x 1 root wheel 75B 27 Oct 20:28 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x 1 root wheel 82B 27 Oct 20:28 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x 2 root wheel 57K 27 Oct 20:28 /usr/bin/pythonw
lrwxr-xr-x 1 root wheel 76B 27 Oct 20:28 /usr/bin/pythonw2.5 -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw2.5
lrwxr-xr-x 1 root wheel 76B 27 Oct 20:28 /usr/bin/pythonw2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
lrwxr-xr-x 1 root wheel 76B 27 Oct 20:28 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7

关于python - osx 上 python 2.7.4 的连接出现段错误 - 正确的行为还是错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20131593/

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