更改 python 解释器 - Sublime Text 2 [英] Change python interpreter - Sublime Text 2

查看:32
本文介绍了更改 python 解释器 - Sublime Text 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用 Sublime Text 2 并且想知道,为了使它成为一个功能齐全的 Python IDE,是否有一种方法可以更改集成的 Python 解释器以针对系统 Python 安装而不是 Sublime 附带的.原因是我想使用我的计算机上的 python 库和 python 解释器.

I just started using Sublime Text 2 and was wondering, to sort of make it a full featured python IDE, if there was a way to change the integrated python interpreter to target the system python install rather than the one that came with Sublime. The reason is because I would like to use my python libraries that I have on my computer with the python interpreter.

我知道使用我的 python 版本在 sublime 中运行 python 代码,如下所示:如何从 Sublime Text 2 运行 Python 代码?

I am aware of running python code in sublime using my version of python as explicitly shown here: How do I run Python code from Sublime Text 2?

但是,这不会更改您正在运行的 Python 解释器的版本.

However, this does not change the version of the python interpreter that you are running.

有什么想法吗?

推荐答案

Tools > Build System > New Build System.插入文件并使用您的 python 版本:

Tools > Build System > New Build System. Insert the file and with your python version:

{
  "cmd": ["python3", "-u", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.python"
}

这篇关于更改 python 解释器 - Sublime Text 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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