How to set which version of python sublime text uses

后端 未结 2 1689
悲&欢浪女
悲&欢浪女 2020-12-13 14:54

I have been teaching myself python and started out using python 2.7.5 and Sublime Text 2. I recently enrolled in a class and they are using python 3.4. I downloaded and ins

相关标签:
2条回答
  • 2020-12-13 15:45

    Found this on Google.

    Create the file ~/.config/sublime-text-2/Packages/Python/Python3.sublime-build:

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

    You should then be able to choose the Python3 build system.

    If that doesn't work, try this:

    {
        "cmd": ["python3", "-u", "$file"],
        "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
        "selector": "source.python",
        "encoding": "utf8",
        "path": "/Library/Frameworks/Python.framework/Versions/3.3/bin/"
    }
    
    0 讨论(0)
  • 2020-12-13 15:45
    For me worked creating the file ~/.config/sublime-text-2/Packages/Python/Python3.sublime-build:
    {
        "cmd": ["python3", "-u", "$file"],
        "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
        "selector": "source.python",
        "encoding": "utf8",
        "path": "/home/tercio/anaconda3/bin/"
    }
    The "path": "/home/tercio/anaconda3/bin/" is path that is installed the anaconda3 in my computer. Replace this information with her path.
    
    0 讨论(0)
提交回复
热议问题