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

preview_player
Показать описание
In this Python Programming Tutorial, we will be learning how to set the PATH environment variable on the Mac & Linux Operating Systems.

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:

#Python
Рекомендации по теме
Комментарии
Автор

(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'

VictorOlet
Автор

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.

JasonTVification
Автор

Thanks so much for taking the time to make this! Well described and way easier for me to understand than reading!

everydayt
Автор

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

saidadiperi
Автор

Thank you for explaining what things are rather than simply dictating what needs to be done like most videos do. Now I actually know what I'm doing. Appreciated!

GabrielPerboni
Автор

I'm so very thankful for this. Your examples are wonderful, and in helping me in diagnosing why my paths are messed up/packages don't import properly. Until now, I've just swept them under the rug.

goodcompanycoffee
Автор

GREAT video! Helped me solve two different issues I was having! Keep up the great work!

phxdnelson
Автор

Thanks a lot Corey, after years of struggling with the confusion of PATHs, I finally got it, urrayy!

mau_lopez
Автор

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

blackx
Автор

Still the best fucking python youtube teacher on youtube. Anytime someone asks me where to learn python I direct them to you and tell them to watch your whole channel cuz thats what I did years ago. It not only helped me understand whats happening under the hood in python, it helped me understand how programming works in general. Thank you Corey Schafer wherever you are!

beaupersoon
Автор

Thanks so much for this video! I have been taking online classes and working with multiple different projects and vens plus working with jupiter notebook and importing modules using idle from different versions switching from python2 to 3 has been such a nightmare. This video is perfect.

charleswilson
Автор

Your content is truly a gem, It’s so easy to understand .. thank you so much for creating such a great content 👍

AjitKumar-fwfs
Автор

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

mas
Автор

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

mclerato
Автор

Dang Anaconda jacked up my PATH settings! Appreciate this

erniea
Автор

Very important explanation for all beginners.
Thank you!

davida.
Автор

I have checked the problem of missed packages when importing by the editor for 3 days, it's my bad that I did not check with Corey from the beginning, Corey always nails it very well, I hope you are doing well my friend!

EnglishGeekWahoo
Автор

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

tiernotall
Автор

I watched your video full even though it helped me to solve the weird python version path problem on my linux environment. Thank you for the amazing tutorial, it really helped me.

Vinod_Kumar
Автор

I struggled with this for a while - the most helpful part was determining the location with sys.executable. Also I was detoured by putting the $PATH in something called .zshenv - but that didn’t work. So I tried it in .zshrc and that worked. I downloaded the Command Line Tools straight from the Apple Developer Site. So some of the paths are different... like I’ve learned so much from this dude. 🤠👍

jumanjiwarlord