Rob Alsod
Rob Alsod

Reputation: 2945

Using Sublime Text 3 as a Python IDE with 3.3.2?

I recently downloaded Sublime Text 3 (only the demo), and I have found out that you can adjust it so that it highlights Python syntax. I can do all this, yes, but I cannot run it like an IDE. I tried with the normal Python Build System - it gives an error. To be exact, the error is:

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't find '__main__' module in ''
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u ""]
[dir: /Applications/Sublime Text.app/Contents/MacOS]
[path: Library/Framework/Python.framework/Versions/3.3/bin/]

So, I wrote my own. It is called Python3.sublime-build. Here is the code for it:

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

Again, this doesn't work. I tried adding a path to it, but to no avail. All it does is throw this error:

[Errno 2] No such file or directory: 'python3'
[cmd: ['python3', '-u', '']]
[dir: /Applications/Sublime Text.app/Contents/MacOS]
[path: Library/Framework/Python.framework/Versions/3.3/bin/]
[Finished]

I checked and double-checked the path in which it checks, and the file is there. It isn't missing an extension or anything - I checked that, too. I tried manually running the file; that works, too.

I would really like to get this working, as I am getting tired of IDLE and it's lack of features. Thank you in advance.

Upvotes: 0

Views: 4630

Answers (2)

user3620604
user3620604

Reputation: 1

The word 'Framework' should be 'Frameworks'. And then it works on my mac.

Upvotes: 0

MattDMo
MattDMo

Reputation: 102922

Set your "cmd" to the following:

"cmd": ["/Library/Framework/Python.framework/Versions/3.3/bin/python3", "-u", "$file"],

and it should work. Probably the reason your path addition didn't work was because it was missing the beginning /.

Upvotes: 1

Related Questions