Chapter 17
Top Ten Python Error Messages
IN THIS CHAPTER
Recognizing common error messages
Fixing common problems
Catching errors and exceptions as your code is running
When it comes to tech creativity, error messages are just a fact of life, especially when you’re first learning Python and programming. Error messages appear onscreen to alert you when something is wrong. They’re usually good at pinpointing the problem, but not so good at telling you what to do about it.
This chapter presents the ten most common Python error messages and what to do to fix the problem and get back on track. Of course, you can also get help from artificial intelligence (AI). When asking AI about a problem with your code, include the code that’s giving you problems in your prompt. Often AI can spot and fix the error quite quickly.
Command Not Found
When you’re first learning Python, you may often see the following error message in VS Code’s Terminal:
command not found: python
This message is unnerving when you’re intending to write Python code. But keep in mind that VS Code is a generic code editor, not tied to any one programming language and not tied to any specific version of Python.
When you ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access