‫Welcome back.
‫So let's now instal python and its libraries for Mac OS and we're going to use the latest version which
‫is big.
‫So let's start with going to the Python website and now we're going to go to downloads, all releases.
‫And I would not like to download Python 3.9 because I want to make sure that all the other libraries
‫that I'm going to be using, that they are fully ready for that version.
‫And so all my tests have been successful with Python 3.8.7.
‫And so we're going to go to Mac OS and we're going to download the Mac OS 64 bit into the installer
‫for Python 3.8.7.
‫Do you want to allow downloads on w w w dot python dot org and of course allow.
‫And so I'm going to go to the downloads folder.
‫So here's the installer that I'm going to click on.
‫And so now I have this text, I'm going to click Continue, I'm going to read everything again, I'm
‫going to click Continue and of course I'm going to read everything, continue, agree and install.
‫And then here I have to put my system password with which you log in into your system and so it will
‫start installing Python.
‫And so at some point I will have this folder here with these files and I can just ignore this folder
‫and here you can see that.
‫Congratulations, Python 3.8.7 for Mac OS is successfully installed and now we don't need the installer
‫anymore.
‫So we move it to trash.
‫We can close this folder and we can close this website as well.
‫And now let's test if our python is installed correctly, I'm going to use terminal in order to launch
‫my python programs.
‫I would recommend you to do the same.
‫I would not recommend you to use ides such as Spider or Jupyter Notebook.
‫The animations might not work if you launch your programs from there.
‫The most robust way is to launch them from terminal.
‫And now let's go into our desktop folder CD Desktop CD stands for change directory.
‫So I have a python file here test dot py and I'm going to open it with the idle.
‫I'm going to ignore the shell and I'm going to go where the program is written.
‫Now I don't care about the numpy nor pillar right now.
‫I just want to know if my python is working properly for that.
‫I'm just going to right here print hello world and then exit.
‫That will end the program at that point.
‫And so if I close this file then it's going to ask me if I want to save it and I'm going to say yes,
‫I'm going to close the shell as well.
‫And then here, when I'm in my desktop folder in my terminal, I'm going to write Python three and then
‫the name of the file test dot py.
‫And as you can see it prints hello world.
‫So our python is working very good.
‫But now if I go back to our program and then I delete all this stuff and leave the original program,
‫if I save it now and close the shell and run the program now, then I will get an error because I don't
‫have a numpy library in your terminal right CD so that you would get out of your desktop folder and
‫be in your default home folder again.
‫Before we can install numpy though we have to install pip.
‫Pip is a python package management system.
‫For that we go to safari and then we're going to go to this website, pip dot piper.
‫So P y p a dot io here we go to installation.
‫We're going to make sure that we have Unix or Mac OS here, not windows.
‫And then we're going to come here where you have installing with.
‫Get Dash, peep that pie.
‫And then we're going to copy this line and we're going to paste it into our terminal here and press
‫enter.
‫And then you have to go back to the website and copy this link as well, and then you can paste it here
‫in your terminal.
‫And before you press enter, you have to put here Python three.
‫So a small modification and then you press enter.
‫And now it started installing it and now you have successfully installed the Python package management
‫system, PIP, and now you can write pip install numpy to two equals signs.
‫And now you have successfully installed numpy.
‫1.99.3.
‫And now you can write CD desktop.
‫Now you enter into your desktop folder.
‫Now, before we run our file, let's enter into our file again through Idle.
‫At this point, we don't care about the pillow library.
‫That's the library that you need when you work with images.
‫At this point, we're going to ignore it.
‫We just want to test numpy.
‫And so we're going to right here print and p dot py and then we're going to write here exit.
‫And so if our numpy works, then we should get a py value.
‫So when we close it, then it asks us to save it.
‫We're going to click.
‫Yes.
‫We're going to close the shell and we're going to write Python three and then test that.
‫PY.
‫And as you can see, we get our py value.
‫And that means that our numpy library works in your terminal write cd so that you would get out of your
‫desktop folder and be in your default home folder again.
‫And now we have to install matlab.
‫For that, we write pip install method lib two equals sines and then.
‫And so we have successfully installed our method WLIB and now we write CD desktop because our Python
‫file is in the desktop.
‫And so if we run an animation file here that requires MATLAB, then you can see that the animation is
‫working.
‫Of course, it's very slow.
‫But that's because I'm running the simulation and recording the screen at the same time, and that's
‫it.
‫Now you have all the necessary libraries in case you use the MAC system as well.
‫So I'll see you in the next video.
‫Thank you very much.