0

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.

4

2 回答 2

1

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 /.

于 2013-08-11T16:53:11.353 回答
0

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

于 2014-05-09T13:28:39.277 回答