如何配置Atom以运行Python3脚本? [英] How to configure Atom to run Python3 scripts?

查看:76
本文介绍了如何配置Atom以运行Python3脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的终端中,输入$ which python3,输出

In my terminal, I type $ which python3, outputting

/opt/local/bin/python3

我想配置Atom运行Python3脚本.在我的Atom Config中,我有

I would like to configure Atom to run Python3 scripts. In my Atom Config, I have

runner:
python: "/opt/local/bin/python3"

但是,如果我在名为filename.py的某些脚本中运行以下脚本,

However, if I run the following script in some script named filename.py,

import sys
print(sys.version)

我得到以下输出:

2.7.11 (default, Feb 18 2016, 22:00:44) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]

如何正确设置PATH以使Python3.x脚本正确运行?我可以使用其他包装吗?

How exactly does one set up the PATH for Python3.x scripts to run correctly? Is there a different package I could use?

推荐答案

转到Atom的菜单栏->包->脚本->配置脚本 (或者,您可以使用Shift + Ctrl + Alt + O快捷键)

Go to the Atom's menu bar -> Packages -> Script -> Configure Script (Or, you can use the shortcut Shift+Ctrl+Alt+O)

然后在命令空间中键入python3. 希望它能工作.

Then type python3 to the Command space. Hopefully, it will work.

这篇关于如何配置Atom以运行Python3脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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