2

So, I read through all of Using virtualenv with sublime text 2, but seeing how the accepted answer is clearly incorrect, I'm still very confused.

I'm trying to run my chorus.py file from within Sublime. I've altered my build system to look like this:

"build_systems":
[
    {
        "name": "Scraper",
        "cmd" : ["/Users/thumbtackthief/.virtualenvs/chorus", "$file"]
    }
]

(based on the fact that when I enter os.environ['VIRTUAL_ENV'] from the terminal that's the path that spits out--maybe I'm doing that wrong?)

When I build my file, I get [Errno 13] Permission denied. I'm not sure where to go from here.

1
  • 1
    I'm not familiar with Sublime, but if cmd is actually supposed to be a shell command to be executed, just a path to a Python file (+args) won't do. Python files aren't executable binaries, and the #!/bin/python shebang magic is performed by the shell. So try adding the Python to the virtualenv's python interpreter to the list as the first element.
    – Lukas Graf
    Dec 27, 2013 at 17:28

2 Answers 2

5

Ah. The "cmd" should point to the python folder within the virtualenv:

"cmd" : ["/Users/thumbtackthief/.virtualenvs/chorus/bin/python", "$file"]

Yay.

0
0

Here is my example for tensorflow. I created a build named "tensorflow.sublime-build" with the fellowing content.

{
    "shell_cmd": "source ~/tensorflow/bin/activate && python $file"
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.