Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Mac & Linux)

///Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Mac & Linux)

Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Mac & Linux)

FavoriteLoadingAdd to favorites

In this Python Programming Tutorial, we will be learning how to set the PATH environment variable on the Mac & Linux Operating Systems.

Be one of the first 200 people to sign up with this link and get 20% off your premium subscription.

We will also learn how to modify the PATH in order to switch between different Python versions and executables. This is an essential skill that trips up many people when they first start learning Python and will definitely help you in many real-world situations. Let’s get started…

How to Set the Path on Windows:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:
My Website –
My Second Channel –
Facebook –
Twitter –
Instagram –

#Python

source

By |2020-11-30T10:55:58+00:00November 30th, 2020|Python Video Tutorials|39 Comments

39 Comments

  1. Bibek Singh November 30, 2020 at 10:56 am - Reply

    THANK YOU 🙂

  2. Julia Matolygina November 30, 2020 at 10:56 am - Reply

    Hey Corey! Thanks for all videos you do! Please can you make video about working with Visual Studio Code! There has a lot of issues with same json file when we start use data base in following your flask tutorial… thanks

  3. Rahul Bali November 30, 2020 at 10:56 am - Reply

    Maybe no longer valid since 2020

  4. Dev Op November 30, 2020 at 10:56 am - Reply

    Thanks man you saved me and my operating system to because I corrupted my operating system 5 x on installing python and this is 11th time installing manjaro KDE plasma I am struggling to install python 3.9 and finding the path for it and configuring the path for Atom text editor. Please make a video on how to set environment variable specifically for Linux.

  5. Abdiel Aae November 30, 2020 at 10:56 am - Reply

    I wonder what you get when do you which python2 @3:16 would like to compare paths vs which python3 for understanding. Thanks (you've already made the video so might be too late ).

  6. TheVertical92 November 30, 2020 at 10:56 am - Reply

    I need a little help here:
    My setup is Python3 installed in WSL Ubuntu and i want to work on it remotely via VS Code.
    With Python3 itself is everything fine (it is on PATH). But when i installed pylint via pip, i get a message that says that pylint script is not on path.
    How do i add these packages to path?

  7. Yong Ren November 30, 2020 at 10:56 am - Reply

    this is one of the most useful python intro for beginner! thx a lot

  8. David Peysakhov November 30, 2020 at 10:56 am - Reply

    Thank you. I've learned so much.

  9. Piyush Darji November 30, 2020 at 10:56 am - Reply

    This is amezing video i have ever seen …..Thankyou so much sir

  10. Louis Louisius November 30, 2020 at 10:56 am - Reply

    wow you are very clear in your explanations thank you

  11. Tierno Tall November 30, 2020 at 10:56 am - Reply

    You are the man! all my libraries used to be install on python 2.7. You helped a man today!

  12. Coded Being November 30, 2020 at 10:56 am - Reply

    Trying to do this in sublime text 3

  13. prabesh koirala November 30, 2020 at 10:56 am - Reply

    what does python is hashed mean?

  14. Reinvigorate Tech Pvt. Ltd November 30, 2020 at 10:56 am - Reply

    Thank so much for explaining in deep

  15. Lerato Majara November 30, 2020 at 10:56 am - Reply

    So incredibly helpful. Got unstuck from a problem I've been stuck on for a while. Hitting the subscribe button!!!

  16. Sanyukta Pawaskar November 30, 2020 at 10:56 am - Reply

    Thanks a lot! It was very helpful.

  17. Waffles November 30, 2020 at 10:56 am - Reply

    finally the answers i was looking for. Thank you.

  18. Karan Doshi November 30, 2020 at 10:56 am - Reply

    Wow very well explained very interesting!!!

  19. Reda Bitar November 30, 2020 at 10:56 am - Reply

    Not to get confused and misunderstand, but some of the mentioned methods here only work for Bash, and not ZSH right?

  20. aarush sinha November 30, 2020 at 10:56 am - Reply

    Kindly help me when i type pip3 it doesn't give me the location from the python 3.X folder, how do i change the path for pip?

  21. Vijay Babu November 30, 2020 at 10:56 am - Reply

    Corey, you made my day. Now I can go to sleep happily

  22. BLACKx114 November 30, 2020 at 10:56 am - Reply

    This is such a great thorough tutorial. You explain everything so well. Thank you so much for your time and effort to help others!

  23. Jason A November 30, 2020 at 10:56 am - Reply

    If anyone is trying to do this on Mac Catalina, they have switched from using bash shell to ZSH. This means instead of using nano to edit .bash_profile, you should edit .zshrc instead. Everything else should be the same. Only took me 2 hours to figure this out.

  24. griz the griff dog November 30, 2020 at 10:56 am - Reply

    Hey Corey, much love for the vids! Quick question … my sys.executable is different than what my path should be. Do I change my path to match the sys.executuable, or can I change the sys.executable instead ?? (which I do not know how to do)

  25. Masoumeh Soleymani November 30, 2020 at 10:56 am - Reply

    Cory Schafer, without any exaggeration your tutorial is one of the very best one. Very pleased to find it.

  26. Saida DiPeri November 30, 2020 at 10:56 am - Reply

    This video helped me a lot and saved me a lot of hours. Thank you for the author to breaking down the problem and explaining it in detail! Great job

  27. Tara Thierry November 30, 2020 at 10:56 am - Reply

    Thanks for the great explanation!

  28. yetijoeyetijoe November 30, 2020 at 10:56 am - Reply

    my version of nano on linux mint is very different. It doesn't have anything about path. arg! Anyone have any ideas?

  29. Gabriele Westh Mannucci November 30, 2020 at 10:56 am - Reply

    If you set your terminal to use zsh (Catalina default shell) remember that the new equivalent to ~/.bash_profile is ~/.zshrc (for setting your aliases) and ~/.zshenv (for customizing your PATH).
    se more here: http://zsh.sourceforge.net/Intro/intro_3.html

  30. Roger Rogers November 30, 2020 at 10:56 am - Reply

    thank you

  31. Tim Curtin November 30, 2020 at 10:56 am - Reply

    FYI: You don't actually have to restart the terminal in order for .bash_profile edits to take effect… All ou do is the following:
    type 'source .bash_profile' and it will refresh the .bash_prifile in the system.

  32. Ernie A November 30, 2020 at 10:56 am - Reply

    Dang Anaconda jacked up my PATH settings! Appreciate this video!!!!!

  33. Ivan Miasnikov November 30, 2020 at 10:56 am - Reply

    Hey guys… You need to edit the .zsh file instead of .bash_profile if you've updated your Mac's shell from Bash/sh to zsh like apple recommends in terminal of macOS Catalina (v10.15). Took me half a day to figure it out, so the path finally loads and alias commands work. Read this for more info if you want: https://coolestguidesontheplanet.com/how-to-add-to-the-shell-path-in-macos-using-terminal/

  34. Jack Riminton November 30, 2020 at 10:56 am - Reply

    God bless you! I swear every other guide or video on the web is subtly designed to trip you up except yours. I don't know how you do it, but please please keep doing it? Do you have a Patreon?

  35. HowToExcel November 30, 2020 at 10:56 am - Reply

    @4:36 How did you split them all up at the same time? I am using PyCharm.

  36. Dan T November 30, 2020 at 10:56 am - Reply

    THANK YOU THANK YOU THANK YOU THANK YOU

  37. saaiheswar gamidi November 30, 2020 at 10:56 am - Reply

    Corey could help out to change path for conda, I even changed the path it is showing "common not found",even after I installed and changed the path of anaconda.

  38. Victor Olet November 30, 2020 at 10:56 am - Reply

    (For my future reference)

    2:50 To find location of Python3 (Issue: python2 runs default)

    8:20 Adding paths manually

    13:51 Setting up an Alias

    17:24 Find out which python (exact) you're running if you have multiple virtual environments using 'sys'

    18:45 You've installed a package but not found when importing

    19:38 (Pip show command to show package location)

    21:42 When the CL and Editor are using different python versions (Sublime Text as example)

    25:25 Virtual environments demo and locating its path using 'sys'

  39. Margie Q November 30, 2020 at 10:56 am - Reply

    Hi Corey so I am only just starting out with python. Long story short I deleted a whole amass of preexisting python files on my Mac. I don’t know what they did and I don’t know how badly it’s effected my laptop but now when I run pre-written scripts after having reinstalled python it’s giving me so many errors! I don’t know if you’ll ever reply but I would love the opportunity to fix my mistake by learning some tips from you?

Leave A Comment

*