2

I would like to configure a second build system for Python on Sublime text 3. By default it use Python 2.7. for the time being, if I want to use Python 3.5, I execute activate py35 and it works like a charm.

Here is my original build system :

{
    "cmd": ["start", "cmd", "/k", "python", "-u", "-i", "$file"],
    "selector": "source.python",
    "shell": true,
    "working_dir": "$file_dir"
}

I added this line just before :

    "cmd": ["activate", "py35"],

I've found this question but it didn't help, which command isn't recognized, even if my env is activated :

enter image description here

Tonechas
  • 13,398
  • 16
  • 46
  • 80
snoob dogg
  • 2,491
  • 3
  • 31
  • 54
  • 1
    `which` is a Unix command. https://stackoverflow.com/questions/304319/is-there-an-equivalent-of-which-on-the-windows-command-line – OneCricketeer Sep 24 '17 at 18:24
  • IMO, a more elegant approach would be to add `python` to the PATH environmental variable. The Python installer for Windows has an option for that, but it's unchecked by default. – idleberg Sep 25 '17 at 14:19

1 Answers1

1

You can't add another "cmd". JSON doesn't allow duplicate keys.

You also don't need to activate anything. Give the full path to the Python executable

For example

"cmd": ["start", "cmd", "/k", "C:/Users/name/path/py35/Scripts/python",
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245