Sublime Forum

Python3 on Mac (Big Sur)

#1

Hello,

I am trying to add python3 to the build system. I have added the file python3.sublime in “/Users//Library/ApplicationSupport/Sublime Text 3/Packages/User” following the following articles. On the first one, I keep getting “No build system” and on the last link I get the error message below. I am using Big Sur and have python 3.9.2 installed. I have set python3 as the default version on the Mac and python3 is aliased for “/usr/local/bin/python3”. The file currently looks like:

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

    "env": {"PYTHONIOENCODING": "utf-8"},

    "variants":
    [
        {
            "name": "Syntax Check",
            "shell_cmd": "python3 -m py_compile \"${file}\"",
        }
    ]
}

----- Error --------
/usr/local/opt/python@3.9/bin/python3.9: can’t find ‘main’ module in ‘/Applications/Sublime Text.app/Contents/MacOS/’
[Finished in 0.1s with exit code 1]
[shell_cmd: python3 -u “”]
[dir: /Applications/Sublime Text.app/Contents/MacOS]
[path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Applications/Wireshark.app/Contents/MacOS]

0 Likes

#2
0 Likes