清除OS X上所有其他已安装的python [英] Cleaning out all other installed pythons on OS X

查看:126
本文介绍了清除OS X上所有其他已安装的python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看在上帝的份上,我快要疯了.我在OS X特立独行.看来我安装了许多python(Anaconda,EDA [类似的东西] ...),而我刚从Macports安装了一个.然后从Macports,我为python安装了一个名为py-graph-tool的模块.现在,当我在python中导入该模块时,出现此错误:

Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6

我发现

因此,我想解决方案将是清理所有其他python.所以我的问题是:如何清理所有其他python?

假设您要使用Anaconda Python进行科学工作...请执行以下操作:

  1. 在主目录(~)中创建一个名为.bashrc的文件
  2. 向其中添加以下内容:export PATH=~/anaconda/bin:$PATH
  3. 关闭所有打开的终端

现在,当您打开一个新的终端时,python应该会启动Anaconda Python.

For god's sake I'm going crazy. I'm on OS X mavericks. It seems that I installed a lot of pythons (Anaconda, EDA[something like that] ... ) and I just installed the one from Macports. Then also from Macports I installed a module for python called py-graph-tool. Now when I import this module in python I get this error:

Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6

I found from this question the following: "this error shows up when a module tries to use a python library that is different than the one the interpreter uses, that is, when you mix two different pythons."

So I guess the solution would be to clean all other pythons. So my question is: how to clean all other pythons?

解决方案

Assuming, you want to use the Anaconda Python for scientific work...do the following:

  1. create a file called .bashrc in your home directory (~)
  2. add the following to it: export PATH=~/anaconda/bin:$PATH
  3. close out all open terminals

Now when you open a fresh terminal, python should bring up the Anaconda Python.

这篇关于清除OS X上所有其他已安装的python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆