sublime text3配置Python3运行环境

方法/步骤:

1.打开Sublime Text 3,依次进入Tools-->Build System-->New Build System
2.点击New Build System后,会生成一个空配置文件,我们需要在这个配置文件内覆盖配置信息,覆盖!
3.配置代码需要匹配Python的安装路径

{
    "env": {"PYTHONIOENCODING": "utf8"},
    "cmd": ["C:/Users/Administrator/AppData/Local/Programs/Python/Python37/python.exe", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}
"cmd": ["xxxxxxxxx", "-u", "$file"]  此处XXXXX填写Python3安装路径
如:C:/Users/Administrator/AppData/Local/Programs/Python/Python37/python.exe 

windows查看安装路径:

import sys
sys.path
[
'', 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\Lib\\idlelib', 
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\python37.zip', 
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\DLLs', 
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\lib', 
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37', 
'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages'
]

你可能感兴趣的:(sublime text3配置Python3运行环境)