简体   繁体   English

如何通过Sublime Text 2运行python 2.7.5?

[英]How do I run python 2.7.5 through sublime text 2?

My sublime REPL is currently running python 2.6.1, I have no idea how seeing as I have never downloaded it. 我的崇高REPL当前正在运行python 2.6.1,我不知道怎么看,因为我从未下载过它。 I am trying to install matplotlib and keep getting this error: 我正在尝试安装matplotlib并继续出现此错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named matplotlib

So I thought installing python 2.7.5 would make this work instead, how do I do this? 所以我认为安装python 2.7.5可以代替它,我该怎么做?

When you hit Ctrl ` to go to the console, you are using the internal version of Python that comes included with Sublime Text 2. You cannot run external modules with this version, it is static. 当您 Ctrl`进入控制台时,您正在使用Sublime Text 2随附的Python内部版本。您无法使用此版本运行外部模块,因为它是静态的。

If you want to use your system Python, install Package Control , then install SublimeREPL . 如果要使用系统Python,请安装Package Control ,然后安装SublimeREPL By default, this will use the version of Python that comes first on your system's PATH . 默认情况下,这将使用系统PATH上第一个出现的Python版本。 Once running, as long as you've properly installed matplotlib , you should be able to import and use it within SublimeREPL with no problems. 一旦运行,只要正确安装了matplotlib ,您就可以毫无问题地在SublimeREPL中导入和使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM