欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

sublime3 配置 python3 开发环境for mac

程序员文章站 2022-03-03 19:43:13
...

python编译配置

version python3.9

which python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3

Click : tools -> Build System -> New Build System 新建配置并另存为python3.sublime-build

{
    "cmd": ["/Library/Frameworks/Python.framework/Versions/3.9/bin/python3", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", 
    "env": {"PYTHONIOENCODING": "utf8"}, 
    "selector": "source.python" 
}

SublimeCodeIntel插件配置

click: preferences -> Package Setting -> SublimeCodeIntel -> Settings Default
找到:

"codeintel_language_settings": {
        "Python3": {
            "python3": "/usr/local/bin/python3.3",
            "codeintel_scan_extra_dir": [
                "/Applications/Sublime Text.app/Contents/MacOS",
                "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/arch",
                "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/libs"
            ],
            "codeintel_scan_files_in_project": true,
            "codeintel_selected_catalogs": []
        }

改为:

"codeintel_language_settings": {
        "Python3": {
            "python3": "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3",
            "codeintel_scan_extra_dir": [
                "/Applications/Sublime Text.app/Contents/MacOS",
                "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/arch",
                "~/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/libs",
                "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3",
                "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3/site-packages"
            ],
            "codeintel_scan_files_in_project": true,
            "codeintel_selected_catalogs": []
        }

Anaconda插件配置

click: preferences -> Package Setting -> Anaconda -> Settings Default

找到:“python_interpreter”

改为:

"python_interpreter": "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3"