Skip to content
CBT Nuggets
DemoBook a Demo

Python Development Environments

This skill provides an in-depth exploration of various Python development environments, focusing on those best suited for data analysis and data science. It covers interactive notebooks like Google Colab and Jupyter Notebook, code editors such as Visual Studio Code, and integrated development environments (IDEs). Additionally, it delves into package management tools like Anaconda and Conda, and offers a high-level overview of Docker for containerization in production environments. Learners will gain insights into selecting the most appropriate tools for their Python projects.

Full skill from Python for Data Analysis. Preview the training IT teams trust.

Updated

1h 1m

Skill 1 of 7 in Python for Data Analysis

What you'll learn

  • Compare code editors and IDEs such as Visual Studio Code with interactive notebooks like Google Colab for data analysis work
  • Create Google Colab notebooks that combine code cells with Markdown or HTML text cells, LaTeX formulas, links, and images
  • Install Jupyter Notebook with Anaconda and launch it from a project folder using terminal commands
  • Create and manage isolated Conda environments with conda create and conda list, specifying the Python version per project
  • Explain how Conda and Docker differ, including Docker images versus containers and why containers reduce production conflicts

Free 61-minute video lesson with a full transcript and knowledge checks. No account needed to watch.

Overview

In this skill, you'll explore various Python development environments focusing on environments best suited for data analysis and data science.

Important Terminology

  • Interactive Notebooks - an interactive development environment that contains shareable live code, equations, visualizations, and text.
  • Code Editors - a text editor specifically designed for editing code.
  • Integrated Development Environments(IDEs) - a code editor with added functionality, such as automation tools and debuggers.
  • Cloud Computing - managed and on-demand availability of computer resources of data storage and computer processing.
  • Anaconda - a distribution of the Python and R programming languages for data analysis, data science, and machine learning that simplifies package management and deployment.
  • Conda - a Python-level package management tool that isolates packages using Conda environments.
  • Docker - an OS-level package management tool that delivers software in isolated packages called Docker containers.

Supplemental Files

Introduction to Development Environments

In this skill, you learn what Python development environments are, why they are essential, and how to select the best data analysis and data science environment for your projects. It is worth noting that the last three videos in this skill are optional, depending on your needs. So, if you are new to Python, feel free to skip the videos on Anaconda, Conda, and Docker. You can always return to those videos once more comfortable with Python.

According to Kaggle's State of Data Science and Machine Learning 2020 survey, interactive notebooks are more than twice as popular as their code editor and IDE counterparts. So before you start learning Python, it's a good idea to understand the landscape of Python development environments at your disposal.

Code Editors and IDEs vs. Interactive Notebooks

So what's the difference between code editors, IDEs, and interactive notebooks? Which is the best environment for working with data, visualizing your findings, and collaborating? Watch the video below to find out.

Knowledge Check

Visual Studio Code is an iterative development environment.

Installing Google Colab

Google's Colaboratory, or "Colab" for short, is an interactive cloud-based version of Jupyter notebook that works in a browser. You can start writing code with almost no setup, and Colab is well suited for educators, data analysts, data scientists, and machine learning engineers. All you need to get started is a Google account.

If you want to code along, watch the video and be sure to connect your Google account to Colab first. Then, download and follow along with the Colab notebook linked below.

Download Colab notebook: 1_3_getting_started_with_google_colab_START.ipynb

Finally, follow the instructions at timestamp 2:05 to upload the above linked Jupyter notebook file into your new Google Colab account.

Knowledge Check

You can upload and use a Jupyter notebook file with Google Colab.

Knowledge Check

What is the file extension for a Jupyter notebook?

Installing Jupyter notebook with Anaconda

Anaconda is a Python and R distribution for data analysis, data science, and machine learning that simplifies package management and deployment. It's best to use Anaconda when installing Jupyter notebook and managing packages such as pandas, Matplotlib, Seaborn, etc.

Knowledge Check

What is the command to run Jupyter notebook in the command line?

Managing Projects Environments with Conda

Now that we have Anaconda installed, we want to create a new Data Analysis environment using Conda. Why not use the base environment? Great question! In short, we want to create isolation for each project because they may use different packages, so it's nice to start with a new environment each time. Additionally, environments are easy to share between teams and make collaboration manageable.

Be sure to download the Conda cheatsheet PDF for future reference.

Knowledge Check

What is the command to create a Conda environment named py27 running Python 2.7

Running Anaconda with Docker

Last but not least, we have Docker. We won't learn how to install and use Docker in this video. Instead, we will cover a high-level overview of Docker images and containers and why they might be helpful when working in a production environment.

Knowledge Check

A Docker image is

Select all that apply.

Docker IRL 🤣
Docker IRL 🤣

Conclusion

Python development environments play a crucial role in your day-to-day experience when building applications or working with data analysis, data science, or machine learning. Having a solid understanding of the most popular Python development environments available will help you decide which environment is best for any project. I hope this skill has been informative, and I thank you for viewing. Happy coding! 🙌🏼

View Transcript

Introduction to Development Environments

0:00(no audio) Hello, everyone. My name is Jonathan Barrios, and in these set of videos we're gonna talk about Python development environments. So you might be asking yourself, well, why don't we just install a code editor, like Visual Studio Code, and be done with it? That's a great question. However, there are so many tools available to us, especially when we're working with teams, and in the context of data analysis and data science that it's worth going over the landscape of tools available to us.

0:34Let's take a look. This is Visual Studio Code. This is the Code Editor part, and Visual Studio Code, it is also an IDE, which means that it's a code editor with some added tools. For example, this section down here allows you to do some debugging, connect to the terminal, and even connect to a GitHub repo. All of these are extensions that really, again, extend the functionality of the code editor. So this is more of an integrated development environment, which is really great, and I really enjoy using this.

1:07However, I recommend Google CoLab, which is an interactive notebook, when working with data science and data analysis. This is Google CoLab, a very straightforward tool where you interact with text cells, code cells, and when you run your script or your code, you get the output just below. One of the greatest things about this is that there's little to no setup. You just have to connect your Google account, and then you're ready to go.

1:38If you wanna move on to Jupyter Notebook, it's a best practice to install Anaconda. Anaconda is a Python distribution that contains all of the data science and data analysis packages that you're gonna need for your projects, and it's a great tool to use to install Jupyter Notebook locally. Jupyter Notebook kind of looks like an article where you would have a little bit of text and some examples, a little bit of code that outputs something, so you really don't need to know Python to read this interactive notebook, right?

2:12And compared to Visual Studio Code, you show that to somebody that doesn't know Python, it's gonna be intimidating, and it's not nearly as accessible as an interactive notebook. The difference between CoLab and Jupyter Notebook is that Jupyter Notebook is installed locally on your machine alongside with Anaconda, so that means there's more setup involved. Google Cloud, on the other hand, has very little setup, almost no setup at all, and Conda environments is a very important aspect, again, requiring a little bit more setup for Jupyter Notebooks, but this allows you to keep your environment separated from all of your other projects.

2:50So you might be asking yourself, well, why is that important? Well, this environment.yama file allows you to save or freeze all of the dependencies that you have in your project, and easily share that with the team, and they can use this file to install that same project on their machine, so it's a great way to collaborate. This is important because different packages might have different versions, which may create conflicts. So this is a great way to deal with that. Finally, you have Docker, which is super popular, and it's similar to how Conda works, except Conda is more at the Python level, so it's dealing with libraries and packages where Docker is dealing at the OS level.

3:33You can install Anaconda with Docker, and have Docker in a self-contained environment using the same OS. This is important when you're working in a production environment where there's sometimes conflicts because of the different OS that you have installed, so this is a great way to deal with that. So in this set of videos, you're gonna learn what Python development environments are, why they're important, and best of all, how to select the best data science and data analysis environment for your projects.

4:04Well, I hope you're excited. I know that I am, and we're right now at Basecamp, so once you understand all about the development environments, you're gonna be in a great way to progress on your Python journey. See you in the next video soon. (no audio)

Code Editors and IDEs vs. Interactive Notebooks

0:07In this video we're gonna be talking about the differences between code editors and IDEs versus interactive notebooks. Normally, if you're learning Python for Python programming, you would probably use a code editor or an IDE, such as Visual Studio Code. But in the scope of data analysis, data science, and even machine learning, it's advantageous to talk about interactive notebooks. In this case, we're gonna be using Google Colab for the interactive notebook and Visual Studio Code for the code editor/IDE.

0:40Let's take a look. Here we're looking at Kaggle's State of Data Science and Machine Learning 2020 Survey. It's worth noting that data science is a larger field that includes data analysis. And machine learning is very, very closely tied to data science as well. So looking at the two numbers, clearly you can see that interactive notebooks take the lion's share of the results. However, there is some overlap and I will say that myself, I use both interactive notebooks and code editors because there's advantages to using either one.

1:15However, when you're learning data science and machine learning and data analysis, interactive notebooks is a great way to start. Let's take a look at some of the differences. When you're working with a code editor, you're working with one single document, let's call this app.py. This .py file extension is really important when you're actually working with a code editor because it lets the code editor know what kind of programming language you're working on.

1:48Additionally, when you write a line of code, nothing happens. (chuckles) If you write a bunch of lines of codes, you have some functions and some function calls, still nothing happens. You have to open a terminal and then type in Python, and the name of the file, which in this case is app.py. Once you do that, then you'll get the results from the app.py file. So this is not an interactive way of programming.

2:19On the other hand, interactive notebooks use something called code cells and text cells, but we're just gonna talk about code cells. So in this example, let's say we had a print statement, and we're just gonna say "Hello." So, print("hello"). Once you hit Shift + Enter, you immediately get an output, "Hello." And that is true for any code that you write inside of code cells. It's a way of interactively programming.

2:49So you write some code here, then you run it, you write some more code here, then you run it, and you get your output, and so on and so forth. So it's an interactive way of programming. So let's take a look at each of these applications one at a time. I went ahead and created this empty folder called vs_code, and to open it with Visual Studio Code, you can just drag it into the icon, and that opens up Visual Studio Code. And you can see that we're in the directory of that empty folder, there's no files in here.

3:20So before we get started, let's look at each one of these sections. I'm gonna close this Start section because it just allows you to open a file, create a new file, and then clone a Git repository. Okay, so let's take a look. Down here we have the Terminal. And so this is what makes Visual Studio Code an IDE because it has additional functionality on top of the code editor, which is this section up here, this is where you would actually write your code.

3:54The section on the bottom where the terminal's located also has a Debug console, an Output, and then you can see any errors that you have, and with helpful information as to which file and which line that error is being generated from. You also have the file explorer which is what we're looking at now, and there's no files inside of "vs_code." Also, you have a search capacity so that you can search for files and extensions. You can connect to a Git repository, so that's a source control functionality.

4:28And some debugging, right? So you can actually, which makes sense, is very common for IDEs to have some sort of a debugging tool. And finally have these extensions. These extensions allow you to extend the functionality of the code editor. So let's take a look at these extensions. If I were to type Python, which seems to be already generated for us, this is an interesting...

4:59Lemme go ahead and close this. Well, I'll just minimize this or make it smaller. So this code extension's very interesting because it offers things like auto completion and intellisense, but it also has something really interesting. Lemme scroll here to the bottom, show this to you. You can also use Jupyter Notebook, which is an interactive notebook. Personally, I've actually found that this is a little buggy, so I don't use it, I prefer to use an interactive notebook, and that'll be either Google Colab or Jupyter Notebook.

5:31But you do have that option, and there's so many different things that you can do inside of Visual Studio Code to extend your functionality that it's a little mind boggling. And it's one of the things that I really like about Visual Studio Code. Right, so let's close this and let's go back to the code editor. To create a file, you can either right click and select New File, or you can use this icon. Let's use the name app.file to create a new file.

6:02The .py file extension is really important because it lets the code editor know what language you'll be using. Once I type .py, you're gonna see just to the left of app, a Python app or a Python icon up here. Now you can see that you're using a Python file extension. So let's go ahead and close this here, this is just telling us about a recommended extension. Let's go ahead and try a print statement. (keyboard keys clicking) So if I save this, nothing happens, right?

6:35This is where you would need to go to the terminal and then type in: python, (keyboard keys clicking) and then the name of the file, which in this case is app.py. And then you would get your output down here. So this is definitely not an interactive way of working. What is cool about Visual Studio Code, is that it has boilerplate, auto completion, intellisense, and different functionality, like for example, if I wanted three lines or four print statements, I could just use that Shift option + Down arrow key, and then immediately get all of these print statements.

7:13So it saves a lot of time. You can also use the Option key to select multiple lines at the same time, which is very helpful. Let me save that. And if I want to run this again, because I'm not seeing any output, I can type in python app.py. And if you noticed, I just hit Up arrow and that'll recall the last command that I've used. So I'll hit Enter, and then I get four "Hello World" statements. This is also very useful for web development, not just Python.

7:45For example, if I created an index.html file and I use the pound sign and then I hit Tab, it auto completes the boilerplate to to start building a website. You can even use a live server to see the website right next to the code editor so that it really speeds up development, not just for Python development, but all kinds of different languages, super useful. So let's go ahead and save this file, go back to app.py.

8:16And this is an introduction to Visual Studio Code and how it's not an interactive development environment, it's a code editor with wonderful functionality. However, if you show this to somebody who doesn't know Python, then it's not as accessible, right? They may be a little bit overwhelmed and if there's a lot of code, even if you have comments, it's not gonna be as accessible. So let's take a look at an interactive notebook. This is Google Colab, and the main difference that you see here, let's go ahead and take a tour of this notebook.

8:51So first of all, you can see that we have a code cell here. If you wanted a text cell, you would just simply go to that button or you could hover and select either a code or text. So this is a text file and here's another, it's a code. Text cell and a code cell. So let's type in the same "Hello World." So I'm gonna type in a print statement. (keyboard keys clicking) And all I have to do is Shift + Enter, and then I immediately get that output.

9:29That output is right here, and that's the same case for every code cells. Let's go ahead and do some more. I will do some math operations, so let's say 10*3. Shift + Enter, and then you get 30. Text cells allow you to... and you can also navigate by moving these up. Let's say we wanted to add a title to this. I double click into that text cell, and let's say I wanted a heading. This is the heading toggle. I have new section, and immediately you see a preview of what it's gonna look like.

10:02So let's just say: Welcome to Google's Colab. (keyboard keys clicking) Shift + Enter, and then we have this nice formatting. If I click on this caret, it'll absorb those two cells. So it's a really great way to organize your files and allow people to see section by section so they don't get overwhelmed. Again, it's more accessible. So let's open this again, and there we have our code cells.

10:35What's important to remember is that there's a lot of other functionality that we're not talking about. For example, if you wanted to connect to Google Drive, you could do that by clicking on this folder, and then you would have your Google Drive files here, which is super helpful. So that's pretty much the difference between Google Colab, which is an interactive notebook, and Visual Studio Code, which is a code editor and IDE. Now that you have a better understanding of code editors and IDEs compared to interactive notebooks, let's go ahead and deep dive into Google Colab and get that set up in the next video, see you there.

Installing Google Colab

0:07Hello and welcome back. In this video we're actually gonna install our development environment, and for that environment we're gonna be using Google's Colab. All we really need to do is search for Google Colab and then we can actually associate it with our Google account. So the only thing that you really need to keep in mind is that you wanna be logged in. So this is, you can see my icon, I'm logged in and ready to go. So make sure you're logged in before you get started. So now that I'm logged in, I'm gonna just type in Google Colab, Google Colab, and it's the first result.

0:45Let's go ahead and check that out. So we're gonna research, I think either one will be the same. So let's try this first one. So I don't have Google Colab actually installed in this account on purpose so that you can see exactly what it's like if you've never installed Google Colab. So I'm just gonna head down to new notebook. Well actually, let's click on this notebook. This is the introductory notebook and it actually gives you a lot of really useful stuff.

1:15So the first thing you want to do is just click copy to Drive. Okay, so now this is a copy of that document. So if you head over to your Drive, let me just go ahead and type Drive. Now, there we go. So now you can see you actually have that copy that you made. And by doing that, you actually have created or connected Google Colab to your account. So if I click in here, you're gonna see that document.

1:47Right? Now if I wanted to create a new Colab notebook, all I have to do is right click, go to more, and then click on Google Colaboratory. I do that and here we go. I have a brand new Google Colab interactive notebook. This is pretty cool. One of the great things about Colab is that you can actually import an IPy notebook. What does that mean? A dot I-P-Y-N-B, right?

2:19Is the file extension of a Jupyter Notebook file. And the reason it has that extension is that Jupyter Notebook used to be called IPython Notebook. So they just kept the file extension, however it's now called Jupyter Notebook. So let's go ahead and upload a Jupyter Notebook file and take a look. To do that, head to file, upload notebook. I'm going to grab one from my desktop, right here, and you can see there's that file extension ipynb.

2:54So IPython Notebook, which is now Jupyter Notebook. I click open. So here's our Google Colab notebook, which is actually a Jupyter Notebook file, which is really awesome. So they're both the same. One is a cloud version of a Jupyter notebook, and the other one is actually a local Jupyter notebook. The files are the same. The only difference that you'll notice is in the user interface, but there's nothing that's gonna be so different that'll hang you up. They're both sort of interchangeable.

3:25So let's dive into this document. The first thing we can do is print "Hello, world!" So to, we're gonna go over all of these things when we learn Python, but for now use, so quotation marks, and then, hello. Helloo! Alright, "Hello, world" exclamation mark. Wow, I can't type today. Alright, cool. So once we run that, the first time you're gonna notice it says connecting over here, then initializing, and then you get your output.

3:56So if I were to run this again, it's immediate, right? So the very first time, you're gonna have a little bit of an initialization waiting period. Okay, so that's our first code cell. This is a text cell up here. If you wanted to change anything here or if you wanted to see what the Markdown is, double click here. And then you can see that raw code. This is a preview over here on the right, which is kind of nice. And I'm using two pound signs and this means h2. So I can toggle between the different sizes, you can notice how it's now pretty small.

4:31If I do it again, it'll go to nothing, then to an h1, but I prefer an h2. And when you have the minimum of an h2 and you run that cell, you can actually collapse that section. So we're done with this print "Hello world!" You can see how the code cell works. Now let's look at pandas. So we're just gonna take a preview of what it looks like to look at a data frame, which is basically a spreadsheet for Google Colab.

5:01Don't worry about any of this, we're just kind of previewing what it will look like once you get up and running with pandas. So we have import pandas as pd and then we're gonna read this CSV, this is a CSV file comma separated values dataset that is on my GitHub. And all I have to do to see that is run this cell. And there you can see that we have this pandas data frame, which is basically like an Excel spreadsheet.

5:33The main difference here, if you notice that there's a zero, when you're working with Excel, it would start with one, go to two, three, four, and so on. But it's basically a spreadsheet. And if you wanted to see a slightly different version, you can click on this magic wand and you get something that looks a lot more like Excel. So it's basically a spreadsheet. And here you have, again, it's the zero based index that has to do with Python. And you'll learn more about that when you learn Python or if you already know Python, you already know that it uses a zero based index.

6:06What's cool about this format, this table, is that you can actually separate it by val, you can preview it in as many sort of list items as you want. So we can go to 50 list items and so on and so forth. All right, so this, that's pretty much it. To close this, I'm gonna click this and it gets rid of that. Just organize this by closing that pandas section. And then let's talk a little bit about markup. So markup is very similar to HTML. So if you already know HTML, the good thing is that you can actually use HTML inside of these text cells.

6:41So let's take a look at how they work. If I double click here, you're gonna see everything that's inside of this. So h2 heading, if I wanted to actually just type in h2, and then you need to write a space, add a space, and then you have the same equivalent as if we were using two pound signs, right? So you can see that Markdown is a superset of HTML and they're sort of interchangeable. Markdown is a markup language that is a superset of HTML.

7:14It's baked into Colab and you can toggle not just the headings, but bold, italics, links, indents, ordered and unordered lists and much more. So what do I mean by that? Well, here's a toggle. Here's bold, italics. This is a code example. So format as code. And if you wanted to add a link, pictures, indent, here are the lists. You can actually add a horizontal rule, and this is LaTex, which we're gonna talk about next. And nobody needs introduction to emojis.

7:44You can add some emojis, and reposition Markdown preview. So this will change this preview here and put it to the bottom, but I prefer actually having it on the right so that I can actually see what's going on above and below. So to run this cell, to get back to where we were, shift enter. So here's some headings, and we can actually add list items. If I hit enter, it just takes me to the next line. It takes some getting used to. If you hit shift enter, then that's, oh, okay, this is something that you might see.

8:18"Colab is for interactive use. So please confirm that you're present and ready to continue." "I'm not a robot." Okay, so you'll see that from time to time. If you're working in a notebook and you leave it idle, Google will check in because you're using Google's resources. So that means that you're using their computer and somewhere in their data center. So they like to check in with us. Okay, so here's the lists. So if you wanted to create a list item, you would just click, let's do an ordered list.

8:49That's as easy as that. If you wanted to do an unordered list, same thing. And it just shows you the how to create them, right? So if you wanted to create a third one, you would just follow the same instructions. Right? And then it shows up in the preview and then again, shift enter, and then you're inside, or you exited that code cell. Alright, so let's move down to LaTex. So let's take a look. LaTex is also baked into Colab and to display Colab, all you do is click on this pitchfork.

9:21So this is just an image. So lemme show you what I mean. If I double click on this cell, you can see that this is the image. So this is one way to actually add an image. You can also use this icon, and we'll talk about the differences a little bit later. But first, let's say I wanted to create a pi symbol, right? Or theta or something like that. All you need to do is click on this pitchfork and then type pi.

9:52And then you can see pi from the dropdown menu and all of the, I mean this is so convenient. Yeah, so here's pi, and you can see it pop up over here. Now if that's too small for you, you can also increase the size, but before we do that, let me show you a few ways of notating LaTex. So one way is definitely with this pitchfork. The other method is actually to use these dollar signs. So let me show you again with the example of pi.

10:23So you create a dollar sign or two dollar signs, and then inside of that you would use the forward slash and then pi. And then again it shows you that notation, and then you get pi. However, you can also add different things. So you can change the size, for example, forward slash large makes it bigger, right? Large. And you can do small and I think medium. Let's try medium. No.

10:54So we can do small. Right. And I think by default it already is small. I think it's the same size. Yeah. So if you have multiple lines, you can actually just have a dollar sign and some math here. Let's say times nine. And then you add some space, maybe a division. Let's see, no.

11:24So to actually add a division sign, we can forward slash that. Let's try that one more time. There we go. So division. So it's pretty straightforward. That dollar sign is, it's kind of unusual. So let's see if we can get rid of that. I think they might need to be on the same line.

11:59There we go. (chuckles) Okay, so it takes some getting used to. This is a good example of one using the dollar signs and then you can add multiple lines or you can have them on the same line. Whenever I'm creating formulas, I like to use this, have them all in one line like this and I'm using large, if I took this away, you would see that it would be much smaller, right? So I like to have the size a little bit larger than normal sometimes because it's easier to read.

12:32So that's pretty much LaTex, and there's some resources down here. This is a really great cheat sheet. Let's take a look at this. So anything that you need to see, any sort of symbols that you're not aware of, if here's some set and logic, and let's see, what else? I mean this is all kinds of stuff. What's even better is that if you don't know what the name of one of these symbols is, if you don't have a math background, what you can do is just go back to Google and then just type it in.

13:07So it's really useful to Google for LaTex formulas, and symbols if you forget what they are. Okay, before we wrap things up, let me show you how to create images. You already know that you can use a link. So this one is a link. So if I double click in here, you can see that I have a link to a file in Google Drive. So there's another way to add images. So let's go ahead and do that. So here's our new text cell to add an image by using this insert image icon. What I'm gonna do is just take a screenshot of this image.

13:42So this is my website and this is an article about what is data analytics. So now I have a screenshot of this image. So let's say I took a screenshot and I wanted to add it to the Google Colab. All I need to do is click on this image, here's that screenshot, and I'll click on open. When you do that, you get all of this stuff. So that's why I like to use links. However, when you run this cell, you just get that image. So this is a pretty large sized image, so it takes a lot more vector graphics code.

14:16While you can use this insert image, just keep in mind that it will behind the scenes, give you a lot of code. So, there's other ways of doing that. For example, you can actually maybe even, let's see if we can grab this image address and create a link. So the way you would do that is pound bracket, and then the name of the file, which is, just say data, just for a brevity's sake. And inside of the parentheses is where you would add that, And that's a much cleaner way to do it.

14:53Otherwise you get a lot of vector code. So the best way to do that is just to right click and then grab that image address. Okay? As you can see, Google Colab is really easy to use. There's almost no setup and it's easy to sort of navigate it from the very beginning. There's a lot of helpful links and tools inside of that initial Google Colab document that you have saved. So definitely check that out. Compare that to Jupyter Notebook where you have to install Anaconda, then install Jupyter Notebook using Conda virtual environments, right?

15:26So all of that takes a little bit of getting used to, but the main difference is that Google Colab uses Google resources in the cloud. So computers and CPU somewhere else. And also you're leveraging the Google account and Google Drive, while Jupyter Notebook is something that you install locally on your machine. Well, I hope you found this informative and I will see you in the next video.

Installing Jupyter notebook with Anaconda

0:07In this video, we're gonna install Jupyter Notebook with Anaconda. But before we do, I do wanna mention that this is an optional video and here's why. If you're just getting started with Python and data analysis, Google Colab is enough to get started. However, if you don't have a Google account and you don't want a Google account, or maybe your internet connection is not so great, this is another alternative. And I wanted to give as many resources as I can to accommodate as many learners as possible.

0:39So don't feel like you have to watch this video. Feel free to skip. Also, you can come back when you feel more comfortable with Python. Okay, so without further ado, let's get started. This is the Anaconda website at anaconda.com. And to install, we're just gonna click Get Started, and then Download Anaconda installers. I'm on a Mac and I could click this to install it, but I wanna talk about these additional installers first. So we can install this on Windows, Mac, and Linux.

1:12And I'm gonna talk about Windows and Mac for a little bit. For example, 32 bit and 64 bit. Well, 64 bit is a much more common installation than 32 bit, but make sure that you're using the correct bit so that you can avoid getting errors when you're installing Anaconda. When you're on a Mac, I would recommend the 64 bit Graphical Installer over the command line. They're both the same thing. However, the Graphic Installer is much more straightforward and you can avoid some errors if you don't have a lot of experience with the command line.

1:49So I'm gonna click on the Graphic Installer to get started. Okay, so let's click Continue, and let's take a look at this. It's important to read this, and we're just gonna kind of go over some of the key points together. So by default, there's gonna be a modification to your bash profile to activate the base environment of conda. Furthermore, this is the default location where Anaconda's installed, in case you wanna delete it.

2:21For Windows, keep in mind that you don't need to check the Add Anaconda to my path. And if you're new to Python and pandas, you can leave Register Anaconda 3 as my default Python checked. That's the only difference between the Mac and the Windows installer. This is a standard EULA agreement, so end user license agreement. So go ahead and read that and and accept and continue. Finally, here's where you can change your installation location.

2:51If you wanted to make some customizations as far as your path, you could do that here, but I always just go ahead and click Install and use the default location. Once you've installed Anaconda, go ahead and open the terminal. For Windows users, go ahead and click on Start menu and search for Anaconda. Then click on the Anaconda prompt, which will launch a command prompt or terminal where you can actually type the commands, just like I'm about to do now. The first thing that I'm gonna do is I'm going to type cd to change directories and navigate to my desktop.

3:28And you wanna create a folder. I've created a folder, and I use the makedir command and python_da. I'm not gonna hit enter because I've already created this folder. So what I'm going to do, I'm gonna change directories and navigate into the python_da folder. Once I do that, I moved from desktop to python_da. Let's see what's inside of here. There should be nothing. So the LS command to list the contents shows nothing.

4:01So this is great. Now what we wanna do is launch Jupyter Notebook within this folder. So all you have to do is type jupyter notebook and hit enter. Okay, so this is Jupyter Notebook. This is not an actual notebook. We're gonna create that now by going to New and then selecting Python 3. If you have Python 2 installed, you may see more than one kernel here.

4:31You may see a Python 2 kernel, but let's go ahead and use the Python 3 kernel. Okay, so this should look familiar and very similar to Google Colab, and we can do some cool stuff. Like for example, if you wanna access the terminal and type in, you know, what is the version of Python? Shift + enter, and there's the version of Python. So this pound sign allows you to communicate with the terminal or the command line, and it's super useful.

5:09You can also type in the print statement, which we did before, and the colab, and you get that immediate output. One thing I would like to say is that I'm not using dark mode in Jupyter Notebook, but I was doing that in Google Colab. So that's the main difference. Now that we have Jupyter Notebook up and running, let's talk about how to close it. So instead of just closing this, you wanna make sure that you save your work.

5:39Then you can close the tab. Then you want to go to, you wanna check this. So what's important to note is that this icon is green. Once you shut it down, it'll turn gray, and then you wanna quit this instance of the server. Let me explain what that means. So if you go over here, all of these commands just happened because this server was actually running and hosting Jupyter Notebook over here in the browser.

6:12So it's really important that we follow those steps when you start and you close a Jupyter Notebook session. So let's try it one more time. So I'm gonna open Jupyter Notebook, which is gonna run the server, and then it opens up this page. So let me go back here to show you what's happening behind the scenes. So here you can see that there's no command line, there's no cursor because the server is running. So once that server is running, this is the homepage that we stopped earlier.

6:44So I'm gonna close that. So once the server is running and we have a notebook that we created, all you have to do is click on it to open that notebook. And there we are. We're back at the Jupyter Notebook. When you wanna close it, you follow the same steps. I haven't done anything here, so I really don't need to save anything. So I can just close this and then click on this and then shut down. You can also delete, edit, and view the selected notebook. So like let's click View, and that'll just, it's another way of double clicking it.

7:20So let's go ahead and shut this down. You can also duplicate it, and if you have a bunch of notebooks running, you can check them out here. Let's go ahead and shut down. And if we go back to the terminal, you'll see that, oh, it didn't shut down, so I'm glad we did that. All we did is stopped this instance of this notebook, so it's no longer running. However, the server's still running. So if you wanna turn that off, you have to hit Quit. Okay, so you shut down Jupyter, basically the server, and you'll need to relaunch it.

7:55All right, so here we are. Let's go ahead and type conda info or conda list. These are all of the packets that are in the base installation, so this is why we're gonna be using conda so that we can have our own project directory. When you do that, the base will change to that name of that project directory. So that's it, we've installed Jupyter Notebook with Anaconda using the base installation, and we covered the startup and shutdown process for opening a Jupyter Notebook and closing the server.

8:35I hope this has been informative, and thank you for viewing.

Managing Projects Environments with Conda

0:07Now that you have Jupyter Notebook installed using Anaconda, it's time to move away from the base environment. We looked at the base environment a little bit last time, but let's dive into it and take a look at this together. If I list everything inside of this environment using the conda command, (keyboard clacking) conda list, (keyboard clacking) I can see everything that's inside of this environment. And as you can see, it's a lot. Right, so jupyter notebook is there. I mean, everything is in here.

0:37So everything that you need will be available. So we can just type jupyter notebook, (keyboard clacking) and it'll work right outta the box. It'll just start working. And that's not what we want, we don't want everything inside of the base environment to be available for every project. Furthermore, the more that you install into this environment, the list gets longer and longer and longer. So what we wanna do is create something called a conda environment. A conda environment is just a way to isolate your projects, so that each project has only the libraries and dependencies that you need for that one project.

1:15And this is the best practice, and anyone that you send your frozen file to so that they can spin up your environment will be very grateful that you did. Let's check it out. To create a conda environment, we're gonna be using a Conda Cheat Sheet, which is available for download below this video. This is a great Cheat Sheet that has all the basic commands that you're gonna need. You could also check out their documentation, but I find that this is a very handy way to move forward, especially when you're first learning how to use Conda environments.

1:48So what do we wanna do first? Okay, we already used conda list here, but what we wanna do is create a new environment. We're gonna use the conda create command right here, and name refers to the name of the environment. The reason that this is named 3.5 is because 3.5 is the version of Python. So that makes sense in this case. What we're gonna do is we're just gonna name it python_da.

2:18That said, it's really useful to have the option to specify the version of Python that you want. We won't need to do that in this case, but it's worth mentioning. First, I'm going to clear my terminal, and we're gonna enter conda create, (keyboard clacking) dash, dash, name, and we're going to use python_da for our environment name. Again, if we wanted to use Python version, (keyboard clacking) we would just add that here.

2:49So you could say, 2.7. Hopefully, you don't have to use Python two, but if you did for any reason, this is how you would do that, and maybe you would change the name of the Conda environment. Okay, so let's go ahead and create this. Yes, I wanna proceed. All right, so it's been created. To activate, here's the command, kind of nice, and to deactivate, here's the command. So conda's kind of thoughtful. Thank you, conda.

3:20All right, let's try this out. So what does it mean to activate an environment? Well, first of all, notice that we are in the base environment. Lemme go ahead and clear this again. (keyboard clacking) The base environment is what you will see when you first install Anaconda, and that's where all of the dependencies and packages are listed in that base environment. We've already created our environment, so let's go ahead and list that, (keyboard clacking) conda env list. (keyboard clacking) Whoops, there we go.

3:54All right, so now you can see we have base and python_da. Let's go ahead and activate that. This is what I copied when conda so graciously told us what we needed to do to activate this. So let's hit Enter. And now you can see that we've moved from base and now we're in the python_da environment. So let's list everything that's inside of this environment, python_da. Nothing, and that's exactly what we want.

4:25Add some packages. (keyboard clacking) So conda install, we're gonna ask for pandas, (keyboard clacking) jupyter, (keyboard clacking) and let's ask for seaborn to visualize some data. (keyboard clacking) Do I wanna proceed? Yes, I do. This doesn't take a very long time to download, but I'm gonna go ahead and skip this part. Okay, we've got everything installed.

4:55Let me clear everything and get back to the top. Okay, so let's list what we have in this environment using the conda list command. Just from those three packages, this is everything that we have, and these includes dependencies. So I'm sure you can see from just three libraries that we've imported that you wanna be very selective when you're isolating your packages. Otherwise, when you share your projects, you're gonna be sending a large list of dependencies and packages for no reason at all.

5:27Great, so we're in python_da, and we can use pandas, jupyter notebook, and so on and so forth. If we wanted to type in jupyter notebook, (keyboard clacking) it should work. (keyboard clacking) Well, that's a typo. (chuckling) (keyboard clacking) I'll say, "Wait a minute, what did we do wrong?" And I keep on forgetting the y. (keyboard clacking) All right, let's try that.

6:01Okay, here we go. Great, so we've managed to run the jupyter notebook from our root directory, and that's not what we want. We wanna be inside of the folder. In my case, my example project is in the Desktop, so let's check that out. And there it is, python_da. So you can navigate to that here, and then you would see this Untitled jupyter notebook that we created before. However, it's a best practice to launch jupyter notebook from the directory, your project directory.

6:37So from python_da. So let's go ahead and do that. First, I'm gonna quit the server. All right, and that's fine. So we've quit that. I'll come back here and you can see that we've shut down our server. So now I'm in my route directory, but I would like to navigate to my project directory. Usually, I would use documents, but I'm gonna be using Desktop, just for ease of navigation. So I'm gonna change directories into the Desktop, and now you can see that I'm in the Desktop here.

7:10I'm gonna list the packages or list the contents of that directory. And we have python_da. So I'm gonna change directories again. I'm gonna use tab to auto complete and enter that directory. And I can see that I'm there. Again, I'm gonna list the contents of that directory. And we see the Untitled ipython notebook, which is a jupyter notebook. Let's go ahead and launch jupyter notebook again. (keyboard clacking) There we go. (keyboard clacking) Okay, so here we are in our project directory, and we know that, because we launched from python_da and I know that this is the file that's there.

7:52Now, if I wanna launch this, I can double click it or you can select it and click View. Great, so this should look familiar. We can also, as we did in the last video, access the terminal by using the pound sign. Excuse me, by using the exclamation mark or the bank's symbol. And you can type things like conda env list. (keyboard clacking) And this will return, oops, Shift + Enter.

8:23And this will return everything, all of our environments, right? So we have python_da and base. You can also use the python, or a conda list command to see everything that's part of this environment. And here we are. And scroll through that, and you can see all of your packages and dependencies for the python_da environment. Okay, so this is a great introduction to using conda environments.

8:57Let's go ahead and close this notebook. I'm gonna save the changes, and I'm gonna close the tab. And if you remember, this is the sequence for shutting things down. We can see that it's still active, because the notebook is green. And it's already checked. So if it's not, just be sure to check it so that you can actually click Shutdown. Great, it's grayed out, we know that it's shut down. And what we wanna do is move to the Quit. And what is that gonna do? It's gonna shut down the server.

9:27Perfect, we've shut down the server. And if we go back to the terminal, you can see that we've shut down the server. Okay, great. So what do we do now? Well, if you wanna deactivate the environment, you can say conda deactivate. (keyboard clacking) You don't need to list the name, because it's the active directory. So let's hit enter, and there we go, we're back at the base environment. So this is pretty much everything that we need to do.

9:58As you can see, using conda is pretty straightforward once you know the commands and you have the cheat sheet. So be sure to download that cheat sheet, it's a PDF, and keep that for your reference. Again, I hope you found this informative, and I'd like to thank you for watching.

Running Anaconda with Docker

0:07So far, you've managed to install Aconda Jupyter Notebook and use Conda environments to keep your projects isolated. The last concept that I want to talk to you about is Docker. So we're not gonna really get into Docker because it has a notable learning curve, and you should definitely learn Docker. But what I do wanna talk about is the differences between Conda and Docker. Conda works at the Python level, keeping your packages organized and isolated, while Docker actually has a tech stack and an application inside of a container.

0:46Before we get into the differences between a Docker image and a Docker container, let's go ahead and take a look at how to install Docker. Again, we're not gonna install Docker and learn Docker. I'm just gonna show you a brief, high level overview of how to get started. So the first thing we're gonna do is search for Docker Desktop, and we're just gonna click on this first link. It's also available for Windows and Linux. In my case, I would be using the Apple chip, the M1 chip, but we're not gonna click on that and download that.

1:19But this is how you would get started downloading Docker Desktop. Now we wanna search for an image. So let's talk about the differences between an image and a container. An image contains the tech stack that you're gonna need to run the application. So that's gonna be basically, here's your tech stack, whatever that you're gonna be using. And then we're gonna be running Anaconda for example.

1:51A container, on the other hand, is an instance. So once you have this image and you use the command docker run, again, we're not gonna get into the specifics of how to use Docker, but then you would get an instance, and so you would have a running instance of that Docker container, and then you can do things like run a Jupyter Notebook or Matplotlib, pandas, whatever you want it to run, so that that Anaconda instance would be available inside of this container.

2:24You could also decide to delete that container and then run a new container using the same docker run command. And then you would have this new container. They would be identical if you didn't use anything different. However, it's important to note that you can start, stop, and delete a container. So you can delete this and then start a new instance. So that's the difference between a Docker image and a Docker container.

2:57So let's search for a Docker image from Google, and we're gonna search for Anaconda3 Docker image. There we go. And we're gonna click on this first one right here. The difference between Anaconda3 and regular Anaconda is basically version 2.7, and that's not what we want. We want to be working with Python three, so this is why we're gonna click on this command.

3:32So this is where you can actually pull Docker into Docker Desktop, and this would be the image that you would execute, and then you would have available an instance, so you can run an instance, and then you could use that instance to run Jupyter Notebook. It's much like a virtual machine, if you know what a virtual machine is, which is a complete operating system, Docker just uses the tech stack to be able to run the application. So in comparison, it's much lighter. But it's important to mention when you're using conda and you share your project with somebody in a production environment, there may be some conflicts due to the operating system.

4:11So using a Docker image is a great way to work in a production environment so that you can minimize conflicts. If you wanna learn more about Docker, you can go to the Docker website or check out one of our courses to learn more about Docker. So that's everything for the Python development environment skill. I hope you found this informative, and thank you for watching.

Frequently asked questions

What does the Python Development Environments lesson cover for data analysts?

The lesson compares code editors and IDEs such as Visual Studio Code with interactive notebooks like Google Colab, then walks through installing Jupyter Notebook with Anaconda and launching it from a project folder. It also covers creating isolated Conda environments and explains how Conda differs from Docker, giving the team a consistent starting workflow before Python coding begins.

Should a data analysis team use Visual Studio Code or Google Colab?

The trainer shows that Visual Studio Code offers autocompletion, IntelliSense, debugging, Git source control, and extensions, but scripts run from the terminal rather than interactively. For data science and data analysis work, the lesson recommends Google Colab, where code and text cells show output directly below and setup takes little more than connecting a Google account.

How do you create a Conda environment with a specific Python version?

The lesson moves learners off the base environment by using conda list to inspect installed packages and conda create to build a new named environment, such as python_da. Specifying the Python version per project keeps each project's packages organized and isolated.

What is the difference between Conda and Docker for Python projects?

Conda works at the Python level to keep packages organized and isolated, while Docker packages a tech stack and application inside a container. The lesson explains that a Docker image holds the tech stack and a container is the running instance, and that using a Docker image in production helps minimize the operating system conflicts that can occur when sharing Conda projects.

How long is this lesson and where does it fit in the Introductory Python for Data Analysts course?

The lesson runs about 1 hour 1 minute and opens a course of roughly 6 hours 46 minutes per learner. It sets up the development environment before the course moves on to data types, numbers, strings, functions, loops, and collections.

How can a Training Manager roll this course out to an analyst team?

Team Leads can assign the course as a baseline playlist for analysts, junior developers, or operations staff who need to read, clean, or structure data with Python. Team reporting then shows per-learner progress and completion, with cohort and group views and completion exports for audit evidence.

What's next?

Ready to keep going?

For your team

Bring this training to your team

See how CBT Nuggets helps IT teams close skills gaps, hit compliance targets, and prove training ROI.

Book a Demo
Just need Python for Data Analysis?

Learning on your own? Browse individual plans ($49/month, billed annually) →

Not ready to buy?
with no purchase required. Already have an account?
Book a Demo