From the course: Customer Insights and Consumer Analytics for Organizations: Tools and Analysis

Installing Python

- [Instructor] So I'm going to be using Python for half of the demos in this course. If you'd like to follow along, you'll need to have an environment similar to mine. So in this video, I'm going to show you how to install the necessary pieces and parts for Python. The work that I do in Python is done from a Mac, so that's what we'll be looking at here. If you're on Windows, you should be able to use this video as a general guide, without the specifics, and I'll provide a reference at the end of the video, as well. First off, one of the things you can do is check your machine to see if you're running the necessary components. You might have everything that you already need, and then again, you might not, so let's just take a look. Now, on a Mac, there are a few things that we need. Terminal, Xcode, Homebrew, Python 3, PIP, and Jupyter. So, I'm just going to go ahead and close out of the Python website. And I've got Terminal already open up, here. So, first off, you can check Xcode. The way you can do that is you can type usr/bin/xcodebuild -version. And so we see that we're here, we're running Xcode 10.2.1, and so that looks good. And then we're going to ago ahead and check on Homebrew. So we can do brew --version. And we can see here that we're running Homebrew 2.1.6, so that looks good. And then what about Python, so if I type python --version, as well. We can see here that we have Python 3.7.3, and so that looks good, too. And then, how about PIP? P-I-P --version. And we can see that we've got pip 19.0.3, some of your version numbers might look a little different if you're getting feedback that you actually have some of these components. As long as you have Python 3, you should be in relatively good shape. And then we'll check on Jupyter, which is jupyter, with a Y, that is, and then --version, as well, so we can see that we've got that. So, here's how you can go about installing each of those elements, if you're missing anything. Now, for Xcode, which is Apple's IDE, and a string of tools that you need for developmental Mac, all you need to do is to visit the Apple App Store, and download and install Xcode from there. And then once it's installed, you'll want to open up, and under the Xcode menu, go to preferences, and then locations, and just make sure that you're running the Command Line Tools. So, let me go ahead and show you that, so I'm going to open up Xcode. Bring up Spotlight, type in xcode, and open that up from there. And then, from the Xcode menu, what you can do is go into your Prefernces... And then like I mentioned, your Locations tab. You just want to make sure that you have something filled in in this Command Lines Tools, that'll make sure that you have the Command Line Tool, or the CLI, installed and working for you. Now, when it comes to Homebrew, one of the things that you can do is just check on the website. The Installation instructions change a little bit from time to time, so what you can do is just type in brew.sh and that will give you the command to install Homebrew right there. That's something that you can just do, right from Terminal. And then from there, what you can is you can install Python, if you are missing Python, and let me just show you the command for that. So it would look like brew install python? So I already have Python installed here, so we're not going to install that, but that's what we would run to get that up and running. And then, there are a few package managers that are specific to Python, and PIP is the, what I consider to be, the preferred one. And now that you've installed Python, you may already be running PIP, so you can go ahead and check on that again, which would be pip --version, and if you need to install it, you can visit pypi.org/project/pip for the installation instructions. And then for Jupyter Notebooks, this will allow for you to set up and run your code, and to see your output, and so if you're needing to install Jupyter Notebooks, the way you can do that is something like python -m pip install jupyter, again with the Y, and if you ran that, that'll run the installation. So if you successfully navigated through those steps, you should be all set up, and again, if you're on Windows, you can visit Python.org, and from there you can find the installer for your system.

Contents