Loading video player…

Adding Python to PATH (Overview)

You may need to add Python to PATH if you’ve installed Python, but typing python on the command line doesn’t seem to work. You may be getting a message saying that the term python isn’t recognized, or you may end up with the wrong version of Python running.

A common fix for these problems is adding Python to the PATH environment variable. In this video course, you’ll learn how to add Python to PATH. You’ll also learn about what PATH is and why PATH is vital for programs like the command line to be able to find your Python installation.

Download

Course Slides (.pdf)

12.2 MB

00:00 Welcome to “How to Add Python to PATH.” My name is Ariane and I’ll be your instructor for this course. You’re probably here because you’ve already installed Python, but when you try typing python into the command line, it doesn’t work the way you want it to. Maybe you’re getting an error message that the python command wasn’t found, or it’s opening up the Windows Store, or maybe it’s running the wrong version of Python.

00:23 Now fixing these errors may involve adding Python to PATH. So in this course, you’ll learn what the PATH environment variable is and how your operating system uses it to find the python command.

00:36 But if the python command isn’t found, it might not actually be a problem with PATH, but instead a problem of using the wrong command.

00:44 Therefore, I’ll also discuss what other commands you should try before trying to edit PATH.

00:50 Finally, if you do need to modify PATH, you’ll learn how to add Python to it, but you’ll also see how to reorder and remove items if you need to solve edge cases that are a bit more complex.

01:03 Please note that there are different lessons for whether you’re working on Windows, macOS, or Linux, and you only need to watch the lessons specific to your operating system.

01:14 Here’s an overview of how the lessons are broken down. So after this overview, you’ll learn all about PATH and its syntax, and this lesson is relevant to all operating systems.

01:26 The next three lessons are all related to Windows. You’ll learn about the different ways to run Python on Windows, then how to add Python to PATH, and finally, how to work with the PATH environment variable from the command line.

01:39 Then, lessons six and seven show how to add Python to PATH on Mac and Linux respectively. And in lesson eight, you learn how to manage PATH on Mac and Linux at the same time, because the process is quite similar.

01:53 So, if you’re on Mac, you’ll want to watch lessons six and eight. And if you’re on Linux, you’ll want to watch lessons seven and eight. Note that for the Linux lessons, I’ll be demonstrating in a virtual machine running Ubuntu. And finally, there’s a short summary of what’s covered in the course.

02:12 Now, let’s get started learning about what exactly the PATH environment variable is. And you should start with this lesson regardless of what operating system you’re working in.

Become a Member to join the conversation.