How To Install NumPy On A Mac

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone in this video we're going to talk about how we can install numpy into python on a mac in this video we're going to be installing numpy directly from the mac terminal allowing you to use numpy in your python shells which we'll talk about here shortly before we begin if you do not have python installed just click on the link in the top right hand corner of your screen now or check out the link in the description below and you can quickly learn how to download and get started in python on a mac to ensure that we have python installed correctly and to get started let's hit command spacebar to open up our max search feature then let's type terminal within our terminal let's type python and then hit tab this should show you all of your python additions as i want to be working in the latest version of python let's just type 3.9 and hit enter this will show you a bit of information confirming that python is installed now we don't actually want to do anything with this right now so let's type quit parentheses like so now to work in our max terminal with python code we need to first create a virtual environment that will contain all of our project's information let's say that i also want to store this file on my mac's desktop as well so it is easily findable so by typing ls and hitting enter you should see desktop as one of the directories that we can move to so let's type cd change directory and desktop now to create a python environment let's tell the terminal that we want a python 3.9 dash m vn study session so this is saying let's make a python 3.9 virtual environment called study session but you can obviously call this file whatever you wish now you can see that when we list our available desktop directories here that is what ls does we now have a file called study session which is the python environment that we just created but how do we go about entering the virtual environment well as you can see here when i list the contents of the study sessions bin we have a file called activate and we're going to type source space our newly created environments name so study session slash bin slash activate now on the left side of your input line we can see that we are now working within the study session environment this line is telling python to run scripts out of the study session shell only now that our virtual environment is created let's ensure that we have the latest version of pip installed quickly though what is pip pip is a python package manager that allows us to install and utilize packages that are not a part of the standard python library let's type into our terminal window pip 3 install dash dash upgrade space pip now it'll either quickly upgrade your pip or tell you that you are up to date the purpose of doing this is to prevent any potential errors that could occur during our installation of numpy as we want the latest version of the package manager after we complete upgrading our pip we can simply install numpy into our python environment so let's type pip install numpy and you can see that it will begin installing the necessary packages after doing this we can now type import numpy as mp this will import the numpy library and allow us to call it using the shorthand np so to test that this is correctly installed let's create a quick matrix to do so let's create a variable called matrix equals np.array and then we just enter a little bit of data like so where each square set of brackets is a new row in our matrix then lastly let's just print our matrix to ensure that it is working correctly by typing print our matrix variable we can see that we are printed out our matrix which is exactly what we wanted this is proof that numpy has been installed correctly we are now ready to begin coding in numpy be sure to check out our learn numpy playlist if you want to learn more about this incredible python library just some final notes if you want to leave our current python environment in the terminal just type quit to tell our python that we want to quit our current python shell and then you can use deactivate or reopen another terminal to get back to our main terminal window then to re-enter our python environment we just simply follow the steps that we took earlier like so i hope that this video helped you install numpy onto python on your mac if you enjoyed please like subscribe and consider checking out our youtube memberships by clicking the join button down below or our patreon page to support the channel however if you have any comments questions or concerns about the information i provided in this video please leave a comment down below and i'll do my best to address your concerns
Info
Channel: StudySession
Views: 6
Rating: 0 out of 5
Keywords: How To Install NumPy On A Mac, study session, python, python terminal numpy, numpy, numpy python terminal
Id: s0olXUfWkDg
Channel Id: undefined
Length: 5min 42sec (342 seconds)
Published: Fri Oct 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.