使用 macports 安装 python 3.6 后,在终端上使用 python 时出错
Error using python with terminal after installing python 3.6 using macports
我使用 macports 在笔记本电脑上安装软件包。我用它来设置和安装 python 环境(2.7 版)。安装 python27 并使用 macports 设置 python 命令以指向 python27 我可以在终端中键入:
:~ python
它在我的终端会话中正确打开了一个 python 环境,我可以在其中执行 python 命令。
当我按照相同的过程使用 macports 安装 python 3.6 环境并键入命令时:
:~ python3
环境加载正确,但是如果我尝试在此环境中 运行 任何 命令,例如:
>>> print('Hello')
我收到以下错误:
>>> print('Hello')
Python(24202,0x7fffc0d003c0) malloc: *** error for object 0x10a78f110:
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
只有在我使用终端python环境时才会出现这种情况。出于所有意图和目的,安装 运行 没问题,我可以在我的系统上 运行 python 3 个程序和 IPython 之类的东西工作正常。这是我使用macports安装后进入python3终端环境时的一个特定问题。
我想知道是什么原因导致了这种情况,有什么办法可以解决吗?
我尝试过如下命令:
port diagnose
并删除端口、所有相关端口并重新安装,但我遇到了完全相同的错误。还有其他人遇到过这种情况或有解决方案吗?
请查看此 link #48807,这是一个已知问题,以下几行引自该线程:
Just installed python36 and the install recommend py36-readline and had malloc crashes along the lines of pointer being freed was not allocated python.
Found this thread. Uninstalled py36-readline and installed python36 +readline, which seems to have fixed this.
我使用 macports 在笔记本电脑上安装软件包。我用它来设置和安装 python 环境(2.7 版)。安装 python27 并使用 macports 设置 python 命令以指向 python27 我可以在终端中键入:
:~ python
它在我的终端会话中正确打开了一个 python 环境,我可以在其中执行 python 命令。
当我按照相同的过程使用 macports 安装 python 3.6 环境并键入命令时:
:~ python3
环境加载正确,但是如果我尝试在此环境中 运行 任何 命令,例如:
>>> print('Hello')
我收到以下错误:
>>> print('Hello')
Python(24202,0x7fffc0d003c0) malloc: *** error for object 0x10a78f110:
pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
只有在我使用终端python环境时才会出现这种情况。出于所有意图和目的,安装 运行 没问题,我可以在我的系统上 运行 python 3 个程序和 IPython 之类的东西工作正常。这是我使用macports安装后进入python3终端环境时的一个特定问题。
我想知道是什么原因导致了这种情况,有什么办法可以解决吗?
我尝试过如下命令:
port diagnose
并删除端口、所有相关端口并重新安装,但我遇到了完全相同的错误。还有其他人遇到过这种情况或有解决方案吗?
请查看此 link #48807,这是一个已知问题,以下几行引自该线程:
Just installed python36 and the install recommend py36-readline and had malloc crashes along the lines of pointer being freed was not allocated python.
Found this thread. Uninstalled py36-readline and installed python36 +readline, which seems to have fixed this.