本文介绍了为什么Code Runner在OSX上使用旧的2.71版本的Python而不是3.x?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用更新版本的Python,但是当我键入以下内容时:

I am trying to use the newer version of Python but when I type:

    import sys
    print sys.version_info

我回来了:

    sys.version_info(major=2, minor=7, micro=1, releaselevel='final', serial=0)

在终端中,当我输入 python 时,我得到:

In the terminal when I enter python I get:

Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin

当我输入 python3 时,我得到:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

如您所见,我已经安装了Python 3.3,但是无论我做什么,我似乎都无法在CodeRunner中实际使用它.

As you see, I have installed Python 3.3 but no matter what I do I can't seem to actually use it in CodeRunner.

推荐答案

CodeRunner->首选项->语言->运行命令

CodeRunner->Preferences->Languages->Run Command

将"python $ filename"编辑为"python3 $ filename"

edit "python $filename" to "python3 $filename"

这篇关于为什么Code Runner在OSX上使用旧的2.71版本的Python而不是3.x?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 11:58