How to setup Jupyter & Python on Mac, Windows or Linux Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this one we're going to set up a jupiter project on your local system that is mac windows or linux [Music] the idea is really simple we download python we use the built-in virtual environment manager inside of that virtual environment manager we install and run jupyter now of course this is not the only way to do it but it's the way i'll cover another way to do it would be anaconda or docker if you want to see those let me know in the comments and we'll talk about it then now what jupiter does it allows us to run interactive notebooks for all sorts of really cool things we're not going to cover exactly what jupiter does instead we just want to get it up and running and leave the what it does for another time now i will say running notebooks can be done elsewhere though google collab is a good example of that and so is deep note these are how you can actually run different kinds of notebooks or jupyter notebooks which has also been known as i python notebooks in the past as well because that's actually where it started ipython okay so let's go ahead and get started alright so let's go to python.org hover over downloads and click on python 3.9 or python 4 or whatever future version of python more than likely what we're doing here is going to be pretty much the same across the board if you need help installing python let me know in the comments but now we're going to go ahead and open up that installer and the key here for windows users is to make sure that it's added to your path everyone else you're going to just be able to pretty much follow along with the installer itself and then you will install it it's going to run it and then eventually once it's finished you'll have to open up the terminal or powershell so if you're on windows it's called powershell if you're on mac or linux it's called terminal and this is your command line interface now i will say you can use something like vs code or any sort of ide where you can actually write inside of the terminal or the command line as well but of course i'm just trying to keep this focused on just jupiter so once python actually finishes we'll come back and create our virtual environment all right so python 3.9 was installed for me so i'm going to go ahead and close this out and move it to trash now in some cases you might actually have to create a new terminal window to run this terminal and powershell are built into the systems that they're on so if you need to help finding them they're typically in like your applications folder and in the case of the actual mac it's actually in utilities and near the bottom for terminal right so if you're on windows you just search for powershell and open that up linux users terminal is going to be really easy to find for you anyways so now that we've got this let's just verify that we have python 3 installed with typing out python and then dash capital v in my case and also linux users cases you'll see python 2.7 in here most likely so you might actually have to type out python3-v now if you're a windows user you'll probably just be using standard just python and you'll see 3.9 in there assuming you did add it to the path because there is an option in the installation to do that so now that we have this let's go ahead and create a virtual environment and all i'm going to do here is cd to my desktop or wherever you want to store your code your project code i'm just making it really simple and putting it in my desktop and i'm going to make a directory called venv this is often what is called you'll see it as a virtual environment and they will go ahead and jump into v e and v right so v and v stands for virtual environment now what a virtual environment does is sort of isolate our code from each other so if i do python3 dash module pip and then freeze so dash m pip freeze i can actually see all of the things in python 3 that are installed on my system notice that jupiter is nowhere to be found okay that's important the reason it's important has to do with the fact that if i try to run jupyter notebook it may or may not work on my system there's a good chance that it won't work on your system and the only reason it's working on mine is because i actually do have it installed somewhere on my system so what i want to do is actually isolate that from everyone else right i want to isolate it from every other project which is why i create a virtual environment so we use python 3 or python whichever one yields the 3.9 right so use that version right here and then we just do the dash m for module v e and v and a period at the end now if you change this to being a absolute path or a relative path it will actually create that virtual environment and wherever you put this path obviously putting that period here puts it into the current directory that i'm in once you hit enter it's going to create a few things for you yours may or may not look like this exactly but it's going to be close now if you're on a mac or linux you'll do source bin activate to activate to this virtual environment if you're on a windows it's going to be dot slash scripts slash activate that's actually how you'll activate it and what it's going to look like is like this so if i do source bin slash activate you'll see the name of the folder that you're in which if you do pwd or dir if you're on windows you'll see this folder actually the name of that folder activated as your virtual environment right some people really like to separate their python versions for the virtual environment so you'd call this like python 3.9 or three nine or something like that i personally like naming my virtual environments after my projects but it's completely up to you now that we're in here i can actually type out python dash v no matter what system i'm on so this sort of isolates this version of python or this project from other projects right that are using virtual environments and now again if i do python dash m pip freeze i shouldn't see anything installed like i did a moment ago right so i had all of these things installed this is again another reason to use those virtual environments and so i'm going to go ahead and install jupiter here really simple that's it just installing jupiter i'll let it run for a moment so as we see here jupiter installs all sorts of packages in here and this is great to make it run completely right so jupyter notebooks are actually servers so we can actually do jupyter notebook just like that and what that will actually end up doing is it will give us these links here so each one of these links i can actually just copy and paste into my local browser there's also a good chance that your browser did open up for you and you'll see something like this okay so naturally we now have jupiter notebooks installed and running so let's just do a quick little test on one of these notebooks by creating a new one right here so in my case i have python3 but you can absolutely use other kernels like you can use a node.js kernel you can use a go kernel there's a lot of them out there but anyway so we'll use the python31 and now in here i can actually write some code so i can print out something like hello world and then i can run this code by clicking run here or i can hit shift enter and that will also run it and so the nice thing about this is if i do something like abc123 i can print out abc of course it's one two three and then i can set abc equaling to 456 right here and then if i go up and run that code again it uses the most recent state or the most recent declaration which is what all of these numbers do now we could spend a lot of time talking about jupiter but this alone is a bit different than just writing a python module and running that module this will allow me to do a lot of rapid iteration especially in the realm of data this is really just scratching the surface maybe not even the surface it's like basically dropping a little pin on exactly what you can do with jupiter because jupiter itself is really just an environment for writing code just a little bit different than what you might be used to now i will say the actual notebook environment itself it is pretty nice to use it in things like colab and and deep note and also even vs code has a way to run these as well where it just looks a little bit different but it still executes and runs in the same manner so whenever you're seeing these running notebook environments you should be aware that it's essentially trying to do the same thing which is executing code in some sort of order and making it a little bit more interactive for you so the other part of this if you are not super technical you will see some that are like hello world and they're actually a document right so some document about code the cool thing about that is we can actually run this document now even if we don't really know what's going on i could just literally hit run run run run or i can do restart and run all and this would actually run the whole notebook right which is actually really really nice and something that i highly encourage that you try out and if you want to see more please let me know in the comments be sure to like and subscribe if you want to see some additional software and coding tools and techniques anyways thanks for watching [Music]
Info
Channel: CodingEntrepreneurs
Views: 70,933
Rating: undefined out of 5
Keywords: python3, python, jupyter, notebooks, google colab, deepnote, ipython, setup, configuration, windows, macos, linux, docker, anaconda
Id: 9tPS-7TWjq0
Channel Id: undefined
Length: 9min 31sec (571 seconds)
Published: Thu Sep 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.