Set Sublime Text3 for Python in MacOS

# Step 1: Check the interpreter file path in Terminal as below

type -a python3

# it will outputs information as below:

python3 is /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
python3 is /usr/local/bin/python3
python3 is /usr/bin/python3

the "/usr/bin/python3" is what you need.
#

# Step 2: Run Sublime Text3 and click the menu as this "Tools->Build System->New Build System", then input the following information with a replacement

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

then "command+s" to save this configuration with the name "Python3.sublime-build"

#

# Step 3: Run Sublime Text3 and click the menu as below:

view-syntax-python

tools-build system-python3

#

# Step 4: Create a new python file such as "1.py" with the following content

print("Hello, World")

then "command+B" to run this file,if it works well that means everthing is ok.

#

 

 

Scroll to Top