Sublime Forum

Build System not working in creating Python3 new build

#1

Please help me figure out how to get this connection. I have searched all over the web and have read discussions/articles and nothing seems to work. I have a Mac OS and I have updated to Python 3.9.1.

This is the code that I was given in my Python programming book I am following.
{
“cmd”: [“python3”, “-u”, “$file”],
}

I save it has python3.sublime-build and when I try command+b I get “no build system”

I have since found different code to enter, and none of that has helped either.

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

From the terminal I have use the $ which python3 and get /usr/local/bin/python3, which I copy and put in the new build system

{
“cmd”: ["/usr/local/bin/python3", “-u”, “$file”],
“selector”: “source.python”,
“file_regex”: “^[ ]File "(…?)”, line ([0-9]*)"
}

Any help is much appreciated. Thank you. Newbie89

0 Likes

#2

Have you saved your file with a .py extension? You can choose the build system using cmd+shift+b.

0 Likes

#3

I save the files I want coded in python with .py. Am I supposed to save the build system with .py too? ex. python3.sublime-build.py?

0 Likes

#4

No, python3.sublime-build is correct. Is it available when you choose your build system as stated before?

0 Likes

#5

Same issue for me. My O.S is windows-10 and I have installed/uninstalled python 3.9.1 as sublimetext several times, but can’t get the simple text print(“Hello Python world”) running with Build or CTRL-B
The suggestion to take a brake and try it again did not help.
An other suggestion is that Python displays a traceback, which is an error report. Where can I find traceback?
Appreciate any help to solve this beginner issue.

0 Likes

#6

What exactly happens when you try to run the build system?

0 Likes

#7

Nothing happens. A terminal screen should appear at the bottom of the sublime Text window with the output:
Hello Python world.
I have tried it over and over from the beginning. By selecting Tools > Build in the menu or Ctrl-B.
Nothing appears.

0 Likes

#8

Did you set the syntax to Python? Did you save the file before you built it?
Does the saved file have a .py extension?

0 Likes

#9

The syntax is set to Python3 and I have followed the instruction to save hello _world.py in the python_work folder. Still no printing at all.

0 Likes

#10

“Python3” isn’t a built-in syntax, it’s provided by a package and iirc doesn’t contain a build system. You can select the python build system using ctrl+shift+b.

0 Likes

#11

Changing the syntax to python build gave the terminal screen at the bottom of sublimetext the following output: [Finished in 0.7s] Missing was: print(“Hello Python world”).
Using ctrl+shift+b did not do anything. Ctrl+b presented [Finished in 0.7s]
Even changing the syntax in automatic did not work either.
Appreciate all support to help a starter with python.

0 Likes

#12

An older tip from OdatNurd Aprl 2020 solved the missing message : choose Tools > Build With... from the menu and make sure that you just pick Python and not Python - Syntax Check .
Thank you bschaaf and Jackeroo for your contribution answering my beginner problem.

0 Likes