Python 3.9 is now the latest version that is offered by Homebrew, so note that the path, in which the symbolic links are installed, is: /usr/local/opt/python@3.9/libexec/bin, which has the Python version, unlike the path that is shown in the video. So you will need to use this path: /usr/local/opt/python@3.9/libexec/bin instead, and therefore, the export command would be: export PATH="/usr/local/opt/python@3.9/libexec/bin:$PATH"
@jesuskristus184 жыл бұрын
Thanks again for the help. But I am getting a ton of tracebacks and exceptions when running pip --version. However I can run pip3 --version so it seems just running pip breaks it and isn't linked to python 3. Can you please guide me?
@TheDataScienceMentor4 жыл бұрын
Hi @Alexander Berg, yeah something is not right. I am replying to your other comment to try to help you figure out what went wrong.
@ilatatke47063 жыл бұрын
After doing this, the default version that I see is still 2.7.16. Where am I going wrong?
@TheDataScienceMentor3 жыл бұрын
@@ilatatke4706 It is most likely a typo in the export command that you added to your .zshrc file. Can you run cat ~/.zshrc in terminal and paste what gets printed here?
I spent 5 HOURS scouring the internet trying to figure out how to make Python 3 the default in the terminal on my Mac and eventually just gave up. However, after following along with your video, I was finally able to get Python 3.9 as the default!! I look forward to watching the rest of the vids on your channel :)
@TheDataScienceMentor3 жыл бұрын
Thanks Madeleine! I am glad you got it to work.
@TheZibbor2 жыл бұрын
Thank you, I was so lost! As a beginner, these things are not intuitive at all and the books for learning python assume some level of expertise when many of us noobs have a deficit. Thank you, thank you for this step-by-step explanation!
@joymirembe23622 жыл бұрын
SAMEEE!!!
@adama-k27102 жыл бұрын
I've spent probably over 24 hours trying to figure this out I started using Python about 8 years ago Still doesn't work for me
@yashwantraut3 жыл бұрын
thanks a ton, i search many web pages to get a solution but not a single one work you explain each and every step in detail
@TheDataScienceMentor3 жыл бұрын
You are welcome, yashwant! I really appreciate it.
@wasiqsaeed75143 жыл бұрын
Must say the most reliable and professional way of fixing that, been looking for a video like this for ages. Thank you
@TheDataScienceMentor3 жыл бұрын
You are welcome, Wasiq! I really appreciate the positive feedback.
@martinevtimov57973 жыл бұрын
I have read so many articles and stockoverflow comments on how to do it for some reason only your video helped me thank you!
@TheDataScienceMentor3 жыл бұрын
Thanks Martin! I am glad to hear that this video helped you. Cheers!
@piyushramnani10143 жыл бұрын
I was lost and confused when I started searching for the solution on git and StackOverflow. Then I found your video. Thanks, man.
@Appsorwebs3 жыл бұрын
Thanks so much, this video just saved me from day 2 of struggle to create a path for python3 on my mac!
@TheDataScienceMentor3 жыл бұрын
Thanks @Apps OrWebs! I am glad you found the video helpful.
@RockxSolidxSam2 жыл бұрын
Literally spent 3 hours the other day trying to get python 3 to work this video is amazing thankyou
2 жыл бұрын
Thank you for this tutorial. I'm new with Mac and I didn't know how to do this. Really straightforward video and easy to understand
@monaabdallah35132 жыл бұрын
I LITERALLY COULD KISS YOU RIGHT NOW!!!! I have been figuring this shit out for A DAY and you are a literal LIFE. SAVER. Thank you thank you thank youuuuuuuu!!!!!!!!!!!!!!!!
@ForgedDimensions2 жыл бұрын
Thank you so so so much, every single time im coding in python I would get extremely discouraged because packages would not download correctly but with your help it finally works!!! I have Python downloaded correctly for the first time. Thank you so much!!!
@Pizza-PizzaP3 жыл бұрын
Thank you so much for this video. So much easier to follow than any article or tutorial I've tried
@OceaniaFlight8153 жыл бұрын
Excellent video, thank you. Best of the many I searched through trying to accomplish this. I really appreciate you mentioning that the "rc" at the end of .zshrc means run config and showing the cat command to verify the file contents. As a second-year student who knows a ton of Linux commands and filesystem types but very little experience actually working within these files, examples and connections like those really help.
@TheDataScienceMentor3 жыл бұрын
Thanks Chrisco9! I am glad you found the video helpful and I really appreciate your positive feedback.
@mariamavagyan67782 жыл бұрын
the best video I found after hours of searching! Thank you!!!!
@deniskomarov1893 жыл бұрын
This worked for me! I'm on OS X Catalina. Perhaps the most challenging part was switching the default shell from Bash to Zsh. It finally worked after checking these three (3) things: 1. run cmd in Terminal (chsh -s /bin/zsh) 2. System Preferences (users, right-click Adv settings, shell dropdown) 3. Terminal Preferences (general, default shell) see this forum for more help: superuser.com/questions/1503484/switching-to-zsh-in-macos-catalina-not-working
@mayfairknights4262 жыл бұрын
Thank you so much! Finally managed to get the default to python 3 hopefully pip will work now once I reboot my machine
@ayshamaqsood69913 жыл бұрын
Clear explanation and helpful. Python is finally working on my Mac! Much appreciated 👍🏻
@TheDataScienceMentor3 жыл бұрын
Thanks Aysha! I am glad to hear that.
@wanderborn.3 жыл бұрын
For the M1 Macs there are few more steps to be done in terminal: Run the commands in that order in terminal, you'll be editing the path and creating the missing .zshrc file, exporting the path to this new file. cd /opt/homebrew/bin/ PATH=$PATH:/opt/homebrew/bin cd touch .zshrc echo export PATH=$PATH:/opt/homebrew/bin >> .zshrc
@shibhuk80182 жыл бұрын
Thank you so much. I am just stating to learn programming don’t know anything. I was trying to find a solution to run Python through Atom but it kept showing Path error. Searched everywhere nothing worked. Followed all your steps along with the new path in the comments finally it worked. THANK YOU
@juliadelorenzo87433 жыл бұрын
you are truly a hero thank so much no other videos helped
@derrickdouglass3 жыл бұрын
Thanks. Helped me get me Octoprint up and running.
@TheDataScienceMentor3 жыл бұрын
You are welcome, Derrick! I am glad it was of help to you.
@vidumini233 жыл бұрын
Woow.. glad to find out this channel. Thank you sir you helped to solve the issue too.. Thank you again for the great content.
@TheDataScienceMentor3 жыл бұрын
Thanks Vidumini! I am really glad you found the video helpful.
@chris_burrows3 жыл бұрын
Good video, you bring great honor to your family.
@TheDataScienceMentor3 жыл бұрын
Thanks for the thoughtful comment!
@izzuddinsuib4313 жыл бұрын
Hi can I know why at 8:28, I cannot have the brew install python working? it says that command not found: brew
@tbalc45292 жыл бұрын
I am getting error, zsh: command not found. I can no longer run python with homebrew. Please advise.
@saleemahmed83642 жыл бұрын
Thanks for this video. right to the point, crystal clear explanation. I spent a long time on the internet before i found this
@didiermeral76202 жыл бұрын
Merci 1000 fois mon ami ! j'ai recommencé car j'avais surement oublié quelque chose, mais quelle joie, à la fin ! great tutorial, indeed: you have a gift, every word in your mooth sounds clearly
@tonykeybenet55523 жыл бұрын
This Teacher is amazing, very well explained in details, it works finw!
@RemindMeToBuiild3 жыл бұрын
Just a HUGE thanks for this!
@TheDataScienceMentor3 жыл бұрын
You are welcome, Ryan!
@krsnabantai3 жыл бұрын
Literally, you saved me! Thank you so much.
@TheDataScienceMentor3 жыл бұрын
You are welcome. I am glad you found the video helpful!
@louisgirardin20303 жыл бұрын
Thx Data Science Mentor ! This is exactly what I was looking for ! This means you have one more follower :-)
@alexaklson15463 жыл бұрын
Thanks Louis! I am pleased to have you on board!
@louisgirardin20303 жыл бұрын
Alex Aklson FYI Just updated from 3.8 to 3.9.2 :-) . I realized that .zsrch requires another update since the path is changing form /python to /python@3.9 :-) Works like a charm!
@TheDataScienceMentor3 жыл бұрын
@@louisgirardin2030 For sure. When I created the video, it was version 3.7 that was the latest. Unfortunately, I am not able to add any annotations to my video to let viewers know of the change in the path for Python 3.9. That is why I added the updated path to a comment that I pinned on this video. Thanks Louis!
@DoubleADubstep3 жыл бұрын
Hi! I have a newbie question. I actually downloaded & installed Python3 via the Python website before watching this video. If I were to go through all the steps in this video - will that affect anything? If so, what can I do to remove the Python3 I've already installed? Thank you!
@ShemOpolot2 жыл бұрын
Hi! Just got a new Macbook Pro M1 13" and it comes with Monterey 12.1. This process was working find but I can't seem to get it to use python3 by default. Please help?
@ingable2584 жыл бұрын
Thank you so much! You just made my day! Got the right way to install the useable python 3.0+ on my mac through this video and could start learning python from scratches :D
@TheDataScienceMentor4 жыл бұрын
You are welcome, @Ingable!
@ssgop37763 жыл бұрын
Thanks a lot and pls continue doing more excellent videos like this ...
@MarisolsAdventures4 жыл бұрын
Another question please. After I install python the folder that it installs it to is /usr/local/opt/python@3.8/libexec/bin and this is slightly different than your screen. Yours has python instead of python3.8. I imagine I copy my link when I do the vim Command instead of making it look like yours ? Thank youuu
@TheDataScienceMentor4 жыл бұрын
Hi @Mari D, yes absolutely, copy your path. It is interesting that Homebrew is starting to add the Python version to the path in which the symlinks are installed.
@emersonjjsouza3 жыл бұрын
Thanks, This tutorial works perfect. Keep going this wonderful videos.
@TheDataScienceMentor3 жыл бұрын
You are welcome! Thanks Emerson for the positive feedback.
@supermarcio_3 жыл бұрын
Thanks for this video! The .profile steps nearly had me giving up
@alexsalikovnz75302 жыл бұрын
Thank you for the tutorial! It helped a lot. Looking forward to explore on your channel😊!
@TheMarketUnion3 жыл бұрын
How do you find the directory that has the link to python 3
@fatimaelmansouri93383 жыл бұрын
Excellent video thank you for your effort
@TheDataScienceMentor3 жыл бұрын
Thanks Fatima!
@ngonidzashemwanjira2082 жыл бұрын
Why do I keep getting a syntax error even though I literally just copied and pasted things into my terminal
@ashishaggarwal18423 жыл бұрын
Thanks! Worked for me on big sur
@TheDataScienceMentor3 жыл бұрын
You are welcome, Ashish! Glad to hear that.
@olaayorinde35443 жыл бұрын
I keep receiving the error 'command not found: brew', is this an indication that my install of homebrew went wrong?
@andreasolis40542 жыл бұрын
Very detailed, thank you! I can learn Python now!!
@Heriterrific4 жыл бұрын
Hi there! I've installed python but without transiting to zsh beforehand. When I run 'python --version' I still get 2.7. While waiting for your answer, I've already switched to zsh but when I run the command 'ls -a' I can still see '.bash' what can I do? thanks
@TheDataScienceMentor3 жыл бұрын
With macOS Catalina, you need to switch to zsh. It is okay to still have a bash file in your home folder, but did you add the export command updating your path to the bash file as well? If so, this is the reason why you still get the 2.7 version. Add the export command to your zsh file and you should get the Python 3 version when running Python.
@bharathnawari23172 жыл бұрын
I am getting error, zsh: command not found. I can no longer run python with homebrew. Please help.
@LoadToCapacity3 жыл бұрын
When I download home brew it says successful but it doesn’t create any new directories as shown in the video. Is this a problem?
@tejsharma16782 жыл бұрын
Hi, I went through it but i got the error that- /usr/local/Cellar/gdbm/./1.22/bin/gdbm_dump: No such file or directory. When I went there is no such directory after gdbm. Please help me to download python and create my own environment.
@fredperkins62932 жыл бұрын
Cannot install Home-brew or latest version of Xcode My MacBook OS is up to date with version 10.15.7, but the Apple Store says Xcode download requires version 11.3 or later. ???? I tried to install Home-brew over an earlier version of Xcode that is installed. No luck after many tries and many suggested fixes.
@luischuquillanquicamarena29033 жыл бұрын
Excellent video, thank you so much.
@TheDataScienceMentor3 жыл бұрын
You are welcome! Thanks Luis.
@johnobadare29163 жыл бұрын
thank you so much 😊
@TheDataScienceMentor3 жыл бұрын
You are welcome!
@klcara994 жыл бұрын
I followed this exactly but when I quit terminal and restart, python is still coming up at the 2.7 version
@TheDataScienceMentor4 жыл бұрын
Hi @klcara99, this most likely means that the path wasn't set correctly in the .zshrc file. Can you paste what you added to the .zshrc file here?
@zhongnansu85164 жыл бұрын
@@TheDataScienceMentor i got the same error, my text in.zshrc is "export PATH="/usr/local/opt/python@3.8/libexec/bin:$PATH". can you help me out
@TheDataScienceMentor4 жыл бұрын
@@zhongnansu8516 Of course. Make sure that the .zshrc file is in your home directory. Also, in your .zshrc file, you don't have the double quotes before the export command, do you?
@nathansu94544 жыл бұрын
@@TheDataScienceMentor thank you for your reply, fix it :)
@bicboi90062 жыл бұрын
When I type in brew install python, it says “No similarly named formulae…” as an error
@micro_Dots3 жыл бұрын
thank you so much. your video helped me so much to properly install everything.
@aryanchitrakar26512 жыл бұрын
when I try to use brew install python, it says- zsh: command not found: brew. please help me to solve this. thanks
@HeroesOfAesthetics3 жыл бұрын
this saved me, thank you so much, just what I needed!!!!
@ZhuTheGirl3 жыл бұрын
when changing shell, the following shows up: "Changing shell for xx. chsh: Credentials could not be verified, username or password is invalid. Credentials could not be verified, username or password is invalid." and python -- version give: "Traceback (most recent call last): NameError: name 'python' is not defined" not sure what is this?
@erickpineda28032 жыл бұрын
Thank you so much. You made it simple.
@frenchmike3 жыл бұрын
how to change the default version my my Mac? I had pyenv and uninstall it but now even though I installed version 3.9.1, my terminal only shows 3.8.. I don't know how to fix this or even how to see all available versions. I know it's not exactly related to the video but any help would be appreciated, thanks
@TheDataScienceMentor3 жыл бұрын
Hi French Mike, yeah this video is about installing the latest version of Python only. If you wish to install older versions and manage multiple versions at the same time, I show how to do that using pyenv in this video: kzbin.info/www/bejne/p4mph6OerrmWmK8 Let me know if you have any other questions.
@kakaz75613 жыл бұрын
am i the only one after type python 3 its appear python 3.8.2 (default , June 8 2020) ? why the machine not ask me to install on xcode ? Please help me
@sagnikmitra65842 жыл бұрын
there is some issue with installing the homebrew. Can you help?
@ashwinnair10353 жыл бұрын
which version should i use in the latest version some libraries are giving problem so shall i use 3.7 version of python as the version dosent cosist of much updates
@Liberty_Freedom_Brotherhood3 жыл бұрын
I'm so lost lol. I typed "python" and got "WARNING: Python 2.7 is not recommended. This version is included in macOS for compatibility with legacy software. Future versions of macOS will not include Python 2.7. Instead, it is recommended that you transition to using 'python3' from within Terminal." but when I type it again it just returns "Traceback (most recent call last): File "", line 1, in NameError: name 'python' is not defined"
@TheDataScienceMentor3 жыл бұрын
Did you get the warning message after you installed Python 3? As for the error, my guess is you had a space before python. Try running it again without any spaces and you should get the same warning message.
@MarisolsAdventures4 жыл бұрын
What if I already installed command line developers tool? Can I still continue with your video and install Xcode ? Thank you!!
@TheDataScienceMentor4 жыл бұрын
For sure. Also, if you don't think you will be doing a lot of development, you can skip installing Xcode and skip to installing Homebrew at 7:10.
@MarisolsAdventures4 жыл бұрын
Tks
@tia50552 жыл бұрын
Can this create a problem in interactive python notebook in jupyter lab? My script.py in jupyter lab when run has no problem. But same code in ipynb in the jupyter lab seems not to recognize numpy installed via pip. Python and Pip has been modified shown in this video.
@buczyslawek2 жыл бұрын
Thanks a lot. Really appreciate your work.
@emreokten4 жыл бұрын
Hi there, thank you for all the detailed explanations. My question is if I install all the tools and python just like in the video (my version is Catalina) when a new version of MacOS is released (which is probably a couple of weeks later) what happens to all this installation. Will I be able to continue running it?
@TheDataScienceMentor4 жыл бұрын
Absolutely! Updating to a new version of Catalina shouldn't impact your Python installation and setup.
@gav240z3 жыл бұрын
Thank you, I am on 3.9 and everything works with PIP. Perfect.
@TheDataScienceMentor3 жыл бұрын
You are welcome! Thanks @gav240z.
@namangupta12493 жыл бұрын
I have installed the python from its official site, how should I make now this as default python?
@MrDombev3 жыл бұрын
Ok my mistake I solved the problem at the end I have to delete .zshrc and .zprofile(They were corrupted) After restarted from scratch et Tout va bien. Thanks so much for your fantastic tutorial
@annadudareva31523 жыл бұрын
Hello! I've got an issue while trying to install python3 in Terminal(I am new in python and even in MacBook): name 'python' is not defined. What should I do??
@TheDataScienceMentor3 жыл бұрын
Hi Anna, welcome to Python and Mac :) When do you get this error? What are you running? When you start terminal, and run python, what do you get?
@evasvete62093 жыл бұрын
Hi. Sorry for this silly question, but where did you get the small symbol next to D (i believe it is called the caret sign). Thanks :)
@TheDataScienceMentor3 жыл бұрын
Not silly at all. Do you mean tilde (~)? On a standard Mac keyboard, you should see it on the key to the left of the number 1 key. So press Shift + this key to type tilde.
@evasvete62093 жыл бұрын
Thank you so much. Have a great day.
@somyabhupal68332 жыл бұрын
hi, i didn't understand the shell thing after 9:00. Can you please help, i'm using M1 macbook air
@GiggleNuggetsZone2 жыл бұрын
First video I watch after I format my mac.
@FPChris3 жыл бұрын
How can I play an MP4 (with audio) on Catalina with Pyglet? It works fine on Windows 10 but I can't make it work on Catalina.
@pitruckingllc39163 жыл бұрын
wow, what can I say Thanks SUPPER! Just subscribed.
@TheDataScienceMentor3 жыл бұрын
Thanks Pi Trucking LLC!
@sudeshkumar56403 жыл бұрын
I have done the above properly and everything is functional. Thanks a ton, sir!! One small thing is now how I can use python2 on my system ?
@TheDataScienceMentor3 жыл бұрын
Hi Sudesh, the point is not to use Python 2 anymore. Why would you want to run Python 2? But anyway, it really depends on what you mean by "use". Do you mean running Python scripts?
@DG-ju2wf2 жыл бұрын
Very helpful, save me hours, Very much appreciated.
@fooocs3 жыл бұрын
When I try to install the dev tools from xcode it gives me the following error message : Installation of the software is not possible, because the software isn’t available on the software updateserver at the moment. Does anyone know and can/is willing to help me out? I'd be grateful.
@TheDataScienceMentor3 жыл бұрын
Hi yumi, are you referring to the command line tools? Do you get this error when running "xcode-select --install"?
@fooocs3 жыл бұрын
@@TheDataScienceMentor Yes sir, I do
@alexaklson15463 жыл бұрын
@@fooocs lnteresting, but you were able to install xcode, right?
@fooocs3 жыл бұрын
@@alexaklson1546 Yes! I did install xcode on my mac, and I opened it once just like the video shows. My mac and xcode are up to date, so I don’t know what the problem is to be fair :/
@thomasyoung91612 жыл бұрын
Hi, when you are connecting to Xcode will this default the Terminal to running through this IDE? Can other IDE be used instead such as VS Code?
@brandonrose70312 жыл бұрын
Exactly what I needed thanks!
@abhisheks21162 жыл бұрын
Hey, Actually i installed vs code in my mac M1 and if i try to get an input as a string like: a = input("enter string inp") print(a) This shows the following error: Traceback (most recent call last): File "/Users/Desktop/python project /proj.py", line 1, in a = input("enter string inp") File "", line 1, in NameError: name 'newinp' is not defined I"m not sure if it has something to do with my default version as 2.7.16, even though in vs code it is showing 3.10.0. please help me out.
@zorroboricua3 жыл бұрын
Why do you installed XCode for? You don't need it to run Python.
@smithadavanam73552 жыл бұрын
Thanka a lot my newly found virtual DS Mentor Sir
@burcakotlu78583 жыл бұрын
Why did you change your shell to z shell? Is it a must? What would happen if it was bash shell?
@TheDataScienceMentor3 жыл бұрын
Hi Burçak, I am not sure if it is a must but if not, then it is highly recommended. In macOS Catalina, Apple moved from Bash to Z Shell, so the whole operating system is developed based on Z Shell being the default shell. I am not sure if it would cause an issues, so it is better and perhaps safer to switch. If you don't wish to switch and you are following my video, then every time I use .zshrc, you need to use .bash_profile.
@burcakotlu78583 жыл бұрын
@@TheDataScienceMentor Thanks a lot for the great content.
@nakitadffs4 жыл бұрын
Thank you so much! This video really helped me!
@TheDataScienceMentor4 жыл бұрын
You are welcome @nakitadffs! Glad to hear that.
@shanlu85963 жыл бұрын
This is super helpful thank you so much
@TheDataScienceMentor3 жыл бұрын
You are welcome, Tan Cai!
@epicwisdomhub3 жыл бұрын
Thank you!
@TheDataScienceMentor3 жыл бұрын
You are welcome, Amraddin!
@triop20102 жыл бұрын
Hi i download python3 prior to watching the video so how do I find my path eg 'user/local/opt..' ? thank you
@NoiSeCommander3 жыл бұрын
Thanks!! Updated python 3.9 and it works perfectly. I am a total beginner but will I be able to run everything via Xcode?
@kevinlease29902 жыл бұрын
this was helpful for me, thanks
@computationalbadass2 жыл бұрын
it didn't work for me because i hadn't even installed python 3 from the python website 👀
@AlejandroMartinez-tc9ob4 жыл бұрын
Very good video ! Thank you for explaining it so much detail. Now for some reason I still get python2. I am watching this video because I was using conda and pip at the same time and I was having to many bugs. Decided to uninstall conda. When I put in the terminal "where python3" I get these two folders /usr/local/bin/python3 /usr/bin/python3. currently
@AlejandroMartinez-tc9ob4 жыл бұрын
These were not the folders were my brew install python went to. Those folders are currently in this path "export PATH="/usr/local/lib/python3.8/site-packages:$PATH" located in the .zshrc as you suggested. Can you please give me advice on what to do?
@AlejandroMartinez-tc9ob4 жыл бұрын
I would truly appreciate your help. Keep up the great videos!
@TheDataScienceMentor4 жыл бұрын
Thanks@@AlejandroMartinez-tc9ob! If you still get Python 2, this means your PATH wasn't configured properly to invoke Python 3. I think you used the wrong path in your export command. It should be the one with the symbolic links, which is "/usr/local/opt/python/libexec/bin". You can find it at 8:31. I am afraid you confused the two. So use "export PATH="/usr/local/opt/python/libexec/bin:$PATH" instead and this should do it.
@AlejandroMartinez-tc9ob4 жыл бұрын
It worked! Thank you. Please keep posting more videos and tips!!!
@bhanuchander67873 жыл бұрын
Thanks, For the tutorial. I have followed the steps and tried to install latest version of python on my mac. But when I closed the terminal and tried to enter python I get this error [ zsh: command not found: python] [/Users/bond1028/.zshrc:export:1: not valid in this context: /usr/local/opt/python@3.9/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin] I don where did I made mistake. could you please help me?
@fabianhaglund57923 жыл бұрын
Useful! Thanks.
@TheDataScienceMentor3 жыл бұрын
Thanks Fabian! I am glad you found it useful.
@claudinemaeleysa12594 жыл бұрын
Cool! Thank you so much! Great help :)
@TheDataScienceMentor4 жыл бұрын
You are welcome, Claudine! I am glad that you found the video helpful!
@salihbalci193 жыл бұрын
thank you so much... really really helpful video..