Hi all,
I am trying to use Sublime Text 2 (ST2) editor to run a python script, but am getting errors. Before I installed Anaconda ST2 worked fine, but now I can't build with ST2.
My Python.sublime-build file in ST2 is the following:
{
"path": "/Users/username/anaconda/bin/python",
"cmd": ["python", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
However, when I try to build and run my script I get the following error from ST2:
[Errno 20] Not a directory
[cmd: [u'python', u'-u', u'/Users/username/Desktop/pythonscript.py']]
[dir: /Users/username/Desktop]
[path: /Users/username/anaconda/bin/python]
[Finished]
I am thinking that ST2 just needs a path to know which python executable to use, but I am unsure what that path is. I have changed the path to /usr/local/bin
, but then I get:
Traceback (most recent call last):
File "/Users/username/Desktop/pythonscript.py", line 3, in <module>
import pandas as pd
ImportError: No module named pandas
[Finished in 0.2s with exit code 1]
Does anyone know why I am getting this error?
Thanks in advance!
The "path" variable should not include python, it should just point to the bin directory I think?
Thanks for the reply, I appreciate the help. Adding the path you suggested I was able to get a result but I got some strange output.
According to this stack overflow thread you need to append Python to your current PATH, like so: