Skip to content
CBT Nuggets
DemoBook a Demo

Set Up a TensorFlow Development Environment

Full skill from TensorFlow Developer. Preview the IT training 23,000+ organizations trust.

48m

Skill 1 of 45 in TensorFlow Developer

👋 Hello and welcome! In this skill you'll Set Up a TensorFlow Development Environment and in this first video, we'll review everything you're going to learn in this skill:

  • Google Colab
  • Anaconda/Conda
  • Jupyter notebook
  • PyCharm
  • VsCode
  • CHALLENGE

Google Colab

In this first video, we'll explore Google's Colab at https://colab.research.google.com/ so be sure to log into your Google account before navigating there. See you in the video!

Knowledge Check

True or False: Google Colab is free but there are no free GPUs available to users.

Anaconda/Conda

In this video, we'll begin to replicate the online cloud version of Jupyter, Google Colab, by using Anaconda, Conda, and Jupyter notebooks. See you there!

Knowledge Check

True or False: Anaconda is a Python distribution for data science and machine learning and offers a free version.

Jupyter notebook

Next, we'll install Jupyter notebooks via Conda environments to then open, explore, and shut down our session properly. Let's do this!

Knowledge Check

True or False: Google Colab is a cloud version of Jupyter notebook.

PyCharm

We won't be installing PyCharm but it is the next most popular IDE, next to Visual Studio Code. Let's check it out and see what the differences might be.

Knowledge Check

What is PyCharm?

Visual Studio Code

Visual Studio Code is by far one of the most popular IDEs for some time due to it's extensible nature and open-source status, oh and it's free. 🔥 We'll probably spend most of our time in this IDE so we'll also add some critical extensions for our journey. 🎒

Knowledge Check

True or False: You can use Conda environments with Visual Studio Code and recall them with a saved workspace file.

CHALLENGE 🎉

Congrats on making it to the challenge and the end of this skill! Here's your chance to showcase your skills by applying everything you learned about ... See you in the Challenge!

Solution Video

Knowledge Check

How would you rate the difficulty of this skill for you on a scale from 1 to 5, with 1 being very easy and 5 being very challenging?

This interactive assessment is available in the full learning experience.

Want to answer questions like this yourself?
with no purchase required. Already have an account?

View Transcript

Set Up a TensorFlow Development Environment

0:00Hello and welcome. My name is Jonathan Barrios and in this skill we're going to

0:04create a TensorFlow development environment. Let's check out everything

0:09that we're going to learn in this skill. The first thing we're going to jump

0:13into

0:14is Google's Colab and Google's Colab 1L is a or an online version of Jupiter

0:27notebook. So what is Google's Colab and what is Jupiter notebook? Well these

0:34are

0:34iterative development environments where you write code in a cell and then

0:40when you execute that cell you get the output right away and you can have as

0:44many cells as you like and then you write some more code and you get output and

0:48you can also get some visualizations of graphs and things like that. When you

0:52're

0:52working with an IDE it's going to be a little different. You're going to have

0:57all your code in one file and then here you would have it like a terminal and

1:03then you can execute that code and then you would get the readings of that code

1:07out here. So it's just a different workflow. One of the cool things about

1:12Google's Colab is that it has everything that you need for data science and

1:17machine learning. For example the packages and libraries already installed

1:21for you whereas Jupiter notebook is a local version so I'm going to put local

1:25and so you'd have to install those yourselves. This is on the cloud made

1:30available by Google. So number two the second video is we're going to check out

1:35something called anaconda that comes with something called conduct. So these

1:41aren't snakes they're snake names but this is really a Python distribution

1:48which

1:48includes all of the ML and data science packages that you could need for pretty

1:54much anything you can think of. And if you need to add something custom you can

1:59just simply add it using conduct. And then number three we're actually going to

2:05check out Jupiter notebook. And we're going to try to recreate what Colab does.

2:11So we're going to take two and three and try to equal the awesome star power of

2:17Google's Colab meaning that we can use a local development environment instead

2:23of

2:23a cloud environment but get almost the same resources. The only thing that to

2:27keep in mind is when you're using Google's Colab they offer GPUs for free. So

2:34you're

2:35not going to get a free GPU at home in a local environment unless you have some

2:39sort of a hookup. So just keep that in mind that's a pretty big distinction.

2:45And

2:46then for number four we're going to jump into IDEs and we're going to check out

2:50PyCharm which is an IDE by a company called JetBrains. And then number five

2:59we're going to check out VS code which is by Microsoft. And funny enough this

3:08is

3:08open source and free to use. And it has a lot of extensions so you can extend

3:16it.

3:16And this is probably what we're going to end up using most of the time but we

3:22will be using almost all of these tools at different times. And then number six

3:28we'll have a challenge where you get to actually apply everything that you

3:32learned in this skill to some sort of final output. In this case it's going to

3:38be some kind of TensorFlow development environment. So what is the context here

3:44?

3:44Well so far in the introduction for machine learning and introduction for

3:49deep learning courses we've used Google's CoLab. It's a great way to get

3:54started because you don't really have to worry about a development environment

3:57and you can just start working. There are some headaches because it is a

4:03computer somewhere in the data center somewhere. So when you want to transfer

4:08files forward and backwards it's not as easy as a local environment. So it's

4:13because it's a computer somewhere else. So there's some hurdles to jump through

4:16.

4:16That's just something to keep in mind. The main power is the ability to use the

4:21GPU in Google CoLab. So when you're using a local development environment it's

4:26good to remember that you're going to be responsible for the GPU and the

4:30compute and all of those things and storage. So that's a huge trade-off.

4:34We'll be discussing this as we go through this course. And finally at the very

4:38end when we get to the challenge you're going to build your own development

4:41environment of choice and well actually not of choice. It's going to be visual

4:46studio code but you're going to do something really specific to set up this

4:50development environment. Then with all the skills that you have you can set up

4:55a development environment of your choice. I guess that's kind of what I was

4:59getting to. And the challenge is VS code but after that you can do pretty much

5:03any of these combinations that you find advantages for your project. All right

5:09so I will see you in the next video which is going to be that video on Google

5:12CoLab. See you there.

Google Colab

0:00Welcome back. In this video we're going to check out Google Colab but first I

0:04wanted to share this repo with you. This CBT nuggets github and this repo that

0:12I

0:12wanted to show you is here Introduction to Deep Learning. We're going to have

0:15our

0:15own repo soon but first I wanted to show you this sunspots CSV right here and I

0:22'm

0:22going to click on RAW so that I can show you how Google Colab works and I'm

0:27just

0:27going to copy this RAW CSV. Now I'm going to go over here to Colab and I search

0:32for

0:32Colab in Google 1L1 word and I'm just going to click on this first one which is

0:38colab.research.google.com and once you're in there and if it's your first time

0:43just

0:43go ahead and click on new notebook and this is going to open up Google Colab.

0:48You definitely have to be signed in to a Google account and that's all you

0:52really

0:52need. Generate with AI here that's something new and I would suggest not

1:01using that and just keep in mind that if you do use it it's going to be a trial

1:05basis and you're going to have to pay for Colab Pro basically but it's a good

1:09idea

1:09when you're first starting out and you're really trying to learn TensorFlow not

1:13to

1:13use AI to write everything yourself. If you're going to use AI ask it questions

1:19to help you learn. So you use it as a tutor but never just copy and paste

1:24anything. Even don't copy and paste the code that I give you. Just code along

1:29with me because that helps you get into long-term memory so that you can write

1:32the code yourself. I just wanted to just give you a heads up about that AI and

1:37now let's do some stuff. Okay so what can we do? The first thing I want to do

1:42is

1:42show you that you can talk to the terminal, the command line, by using the

1:46exclamation mark. I'm going to say Python - version and let this run and to run

1:52this I'm going to shift enter and while this is running this is the very first

1:57time you see that it's connected to a computer somewhere in the cloud. Now it's

2:01connected and we see that we're running Python 3.10. Alright so now I'm going

2:06to

2:06show you how you can import things such as pandas and you don't need basically

2:13any pip install. So let me explain that. Normally when you are working with

2:18packages locally you have to install them. Right so you like let's say you're

2:22using like a Python package manager like pip you'd have to say pip install pand

2:29as.

2:29If you're using Conda environment manager then with Anaconda you would use

2:35Conda install pandas so on. So here this is done for you and it's really nice.

2:40When

2:40we get to Jupyter Notebook which is a local environment we're going to have

2:44to install these using Conda. You could also install it with pip so you have a

2:47choice. So I just wanted to give you a heads up that the nice thing about Colab

2:51is that has all of this included. So if I run this we're not going to get any

2:57errors and we can actually define a data frame and I'm going to say df equals

3:01pd.read_csv and I'm going to pass in that raw file and then I'm going to run

3:08that and then I'm going to call the first three rows of that data frame so we

3:15can

3:15just take a look at it. And now you can see that we're just actually getting

3:19ready to start some data analysis or data science or machine learning right out

3:24of the box. But I think the most important distinction is if you go up

3:29here to runtime and then go to change runtime type you can go from the CPU

3:35to a GPU and I'm going to say okay let's save and now it's connecting to a GPU

3:42and we're there. So look at that we have a Tesla GPU

3:46and it's free. This is pretty amazing because

3:50GPUs are not cheap especially right now in 2024 they're getting pretty

3:54expensive.

3:54Every year is going to get more and more expensive or it's going to become very

3:59scarce because more and more companies and individuals are going to start to

4:03use these resources. So when you're working locally with

4:08Jupyter Notebook you need to have some sort of a GPU. An external GPU card

4:13is very common for PCs but very currently Apple Silicon has made GPUs

4:20in their own chip. So I'm using the M3 chip and that's actually able to run

4:29a lot of models on it locally without having an external GPU. So that's

4:33something new we'll talk more about that but this is something that's really

4:37crucial to keep in mind if you don't have a GPU you might need to use something

4:41like Google Colab. In fact a lot of engineers at

4:44Colab, excuse me at Google, would use Chromebooks and then log into

4:49computers in the back end. So that's how they're able to use Chromebooks

4:52because

4:53Chromebooks don't have CPU or RAM or very much storage at all.

4:58So that's kind of something to keep in mind and it's also a trend.

5:03And we're not doing anything to use a GPU so I'm going to show you the best

5:06practice just to go up here disconnect and delete runtime.

5:11That's how you do that or you can just go back to the CPU by going to

5:14change runtime type. All right so let me close this resources here

5:18gives you a little bit more information about this and again another

5:21opportunity

5:22to upgrade to Colab Pro.

5:26So that's it for this super brief introduction to Google Colab. We'll be

5:30seeing our friend again but for right now we're going to jump into

5:33Anaconda and Conda. See you there.

Anaconda/Conda

0:00Welcome back. In this video, we're going to check out Anaconda, not the snake,

0:05but the Python distribution.

0:07Alright, so I just typed in Anaconda and I'm going to click on this first one

0:13right here, "Unleash AI Innovation and Value."

0:16That's very corporate sounding technique. Alright, so basically, let's just

0:21skip all of this stuff and go to the free download.

0:24We're going to skip registration and then here we can see that we have the

0:28different options.

0:30So if you're on Windows is pretty straightforward. You only have one option. It

0:34's a graphical installer.

0:35With Mac, you can use homebrew and you have these other options, but what I

0:38would recommend, I'm on a silicon, so I use this.

0:42But if you are not and you're using Intel or everything else, just use this one

0:45.

0:46And if you're on Linux, you'll know what to use.

0:49Alright, so I've already installed this, so I'm just going to skip this stage

0:54and then once you have installed this, then unpause or just come back and join

0:59me.

1:00Once you're done installing and it's actually, this usually pops up by itself.

1:06So this would be the first thing you see.

1:08If you don't see this and it's not popped up, then just click on Anaconda Nav

1:11igator.

1:12And here you can see that we have Jupyter Notebook. We can just click on launch

1:16and it would work straight away.

1:18And what else do we have? We have Anaconda Notebook, so they're doing their own

1:23cloud version of notebooks.

1:25And here we have PyCharm. This is what we're going to talk about as well.

1:28We're not going to get into Spider, but that's another IDE.

1:31And Visual Studio Code, which we're going to talk about, it's used to be here,

1:35but it's not here any longer.

1:37I could just click on this button here to launch Jupyter Notebooks, but we're

1:42going to do that in a separate video and we're going to do it a different way.

1:45We're not going to just rely on the Navigator to open it up and click this

1:48every time we want to run this.

1:51And instead we're going to go over here and work with this a little bit. Let me

1:55make this a little bit bigger.

1:57Alright, now that we're here, you can see that we don't have, it doesn't say

2:03base here, but if it did,

2:06it should if you've installed Anaconda. So now I'm going to say Conda Activate.

2:12Then you'll see this. This is probably what yours has already, if you're on a

2:19Mac.

2:20Now if you want to find this for Windows, it's called the Anaconda Prompt.

2:25And what you want to do is just go to the Start menu and press on the Windows

2:29key and then type Anaconda Prompt into the search bar.

2:34And when you do that, you're going to probably see the Anaconda Prompt pop up.

2:38If you don't find it there, it's also available in the Start menu by scrolling

2:43through the list of apps under the Start menu.

2:46Alright, so once you have that up and running, I have Conda activated here, but

2:51this is a base environment where we have all of the packages involved like

2:55everything.

2:56So you don't want to use this. And instead what you want to do is create an

2:59environment.

3:00This is how you do that. Conda create dash dash name and then the name of the

3:07environment.

3:08I'm going to call mine TF_PRO. And then you would install whatever you needed.

3:14Let's say pandas, right, and TensorFlow.

3:19And then once you do this, you click on this and then you scroll through the,

3:23basically it'll ask you yes or no if you want to create it and you say yes,

3:27and it'll create this for you and it'll also install pandas and TensorFlow.

3:32And then once you do that, it'll activate that base for you and you'll see that

3:36here.

3:37I've already created this and so I'm not going to create it, but that's how you

3:40would do that if you wanted to create your own new environment.

3:44And you might be asking, well, why are we doing this?

3:48The reason is you might have one project that has web development stuff like

3:53Python and Django.

3:55You might have another project has nothing to do with web development and it's

3:58just machine learning.

4:00So you have TensorFlow and pandas. The thing about this is when you share your

4:05projects, you don't want to share every project or every package ever made with

4:10every project.

4:11So you want to keep it as tight as possible.

4:14So we only install the things that we need for that project.

4:17And that's very efficient. So you can imagine if you're sharing this with

4:20people, you want them to make it as simple as possible.

4:24So that's some of the reasons why.

4:27All right, so let me keep moving on.

4:30And now what I'm going to do is say, oh, I forgot the name of my environment.

4:35So I'm going to say, Conda and list so that it can show me.

4:38And I can see, oh, here it is. Tf Pro. That's the one that I created.

4:42So I'm going to say Conda activate Tf underscore.

4:48Oops.

4:50Tf underscore pro. There we go.

4:54And now you can see that we're activated. And this is going to be the project

4:58that I'm going to use for the professional TensorFlow developer course.

5:04Right. And so this is why I would call it this. And then I would have all the

5:07packages needed for that project.

5:10If I wanted to run Jupyter Notebook, I would have to install it. So I would say

5:14Conda install.

5:16And then Jupyter, which I've already installed.

5:20But this is how you would do that.

5:22And if you wanted to run it, then all you would have to do is just type in Jupy

5:26ter Notebook.

5:28From wherever your project is. So we're going to do that in the next video.

5:33But I'm just giving you a heads up that that's how it works. And let's say we

5:35're done now.

5:37Okay, I'm done developing. So I'm going to say Conda deactivate.

5:41And when you do that, it goes from TF underscore pro to the base.

5:45But if I did it again, then it just goes away.

5:49All right. So that's about it for this video. And I will see you in the next

5:52video when we jump into Jupyter Notebooks.

Jupyter notebook

0:00Welcome back. In this video we're going to dive right into Jupyter Notebook

0:04from

0:04the terminal right where we left off of. So now here how do we get started?

0:09Well

0:09first of all I'm going to activate Conda. So Conda activate and then what we're

0:16going to do is Conda activate and then the name of the project so it's TF_PRO.

0:22Okay and let's just say that I'm not in that I'm in my users folder but I want

0:31to

0:31be in my project folder. So let me just create one here and I'm just going to

0:35name this github. So what I'm going to do is navigate to das tab and it auto

0:45completes for me and then I'm going to say gi tab and then at auto completes it

0:50kind of knows what these names are in these directories just a little tip there

0:54and then if I hit enter now I'm in that github folder on the desktop. So from

1:00here I'm going to say Jupyter Notebook because I've already installed this

1:06using Conda install Jupyter. So now that I have that installed in this

1:11environment I can just do this and instantly it creates this environment and

1:20I'm going to go over here to new notebook. There's our notebook now I can

1:25double

1:25click on that and now we get to choose a kernel. We're not going to get too

1:31deep

1:31into this right now. If you click on this you can see there's no additional

1:34kernels. There's a way to deal with this so what I'm going to do for right now

1:38is

1:38just select a Python 3iPy kernel. Okay so now that I'm in here I've already

1:44installed Pandas right so if I said let's try the Python - - version just like

1:52we

1:53didn't call that and we're using a newer version of Python 3.12. Okay and what

1:58else? Let's try some Pandas so let's import Pandas. It's PD and I'm going to

2:06define this URL that we copied earlier like this and then gf I'm going to

2:13create

2:13a data frame and use PD.read_csv and then I'm just going to pass in the URL

2:22like that and then I'm going to call the first three the head three first three

2:29rows. Alright let's try that and instantly we get it access that's the

2:36repo grab that CSV read the first three and we're ready to rock so this is

2:40Jupiter notebooks and the only caveat here is that you can't go to kernel and

2:46say give me a GPU because that's your job so we're responsible in a local

2:52environment for providing the GPU in any of the compute requirements something

2:57to

2:57keep in mind and makes these online computers really attractive right so

3:03there's a lot of services that offer this so just keep that in mind but as you

3:09see here it says shut down kernel shut down all kernels what's all this well

3:13this has a little bit to do with how we want to get out of this so there's

3:17different ways of closing this down if you wanted to stop you could interrupt

3:22a kernel like this but what it's pretty common is to go here to file and then

3:28go to shutdown or you can close and shut down notebooks let's try that and

3:35yes I'm okay with that alright there it is and then now we're here if we go to

3:40running nothing is running and then we can go to file and then shut down and

3:47let's shut that down and if we go back over here you can see that our server is

3:52no longer running but we're still here in TF Pro and if you wanted to you could

3:57deactivate conduct deactivate and now we're in base and if you want to do that

4:06again now we're completely out and we can type clear and that's it that's the

4:10end of our session all right so now we're ready for IDEs and I will see you the

4:16next video where we jump into PyCharm and VS code see you there

PyCharm

0:00Welcome back. In this video, we're going to check out IDEs because we've been

0:05looking at Google Colab and Jupyter Notebook and those are interactive

0:10notebooks. Right? They have these code cells, you write something and then you

0:13get

0:14that output, which is really nice. When you're working with an IDE, you're

0:17usually

0:18working with a .py file if you're working with Python and then you're going to

0:21execute that script in a command line somewhere and then it'll give you an

0:26output and it's really hard to see visualizations and things like that. It

0:30can happen, but it's really a clunky way to do it in an IDE. Things have gotten

0:35a

0:35lot better and that's why you basically can work with an IDE now. But for a

0:40minute

0:40there, it was kind of like there was people that were using interactive

0:43notebooks and there's people that were using IDEs. Now the thing happens

0:48where you get this interactive notebook like it could be Colab or it can be

0:55Jupyter Notebooks, that file extension is .ipynb and that stands for IPython

1:02notebook. So that used to be the name of Jupyter Notebook before and then it

1:09changed the names to Jupyter Notebook. So instead of IPython Notebook, we have

1:12Jupyter Notebook but it keeps that file extension anyway. Long story short that

1:16IPynb file extension for production usually needs to get converted to a .py.py

1:22file and so that's why working in an IDE is one of the reasons at least that

1:27makes it very useful. So let's dive into it right now. However, we're not going

1:32to

1:32be using PyCharm. We're just going to kind of talk about it but we're going to

1:36spend most of the time working with Visual Studio Code because first of all

1:40it's free and it has a ton of extensions so we can make it very very flexible.

1:46Alright, let's do this. So here we're going to make your software reality, make

1:51your

1:51software vision a reality. Alright, so developer tools and where is our reality

1:56?

1:56PyCharm. Okay, so here it says the Python IDE for data science and web

2:02development. So that's a lot. So this is like an 18-wheeler compared to driving

2:11your comfortable Honda, right? So that's a famous saying by the person that

2:18created Python and it's true, right? They were talking about different IDEs but

2:24it's a very apt comment because this IDE can do so much stuff and you might not

2:30need to do a lot of that stuff. For example, if you don't do anything else

2:33except for data science, you're not going to need to do web development. So all

2:37of

2:37that, which is a huge amount of tools, can just go away. So it's something to

2:42consider. Alright, so let's take a look at this and this is what it looks like.

2:47Pretty much looks like Visual Studio Code if you're familiar with that

2:51interface

2:52and definitely check out this video if you want to. So here you can see that we

2:57have Python which is great but we also have Django, Flask and Fast API which

3:01are

3:01mostly, I would say these two are for web development. Jupiter, SQL, Anaconda,

3:06and

3:06Pandas, well this is kind of more our sort of flavor.

3:12Alright, so it empowers developers to be more productive and makes difficult

3:15coding tasks easier. And yeah, so again, it's a little bit overkill. There's a

3:22debugger, all this great stuff. Now if you want to dive into the data science

3:29part, we can just click on this to sort of focus in on that and it

3:33can go into all this stuff and this context aware AI, again, that's something

3:37that we saw even with Google Colab and so everybody's going to be doing this

3:42and here you can see that wow, everything that you need, even hugging face,

3:46TensorFlow, Keras, scikit, learn. Anaconda, but it's right and even Docker, we

3:53're

3:53not talking about Docker but this is something that's very, also very, very

3:56relevant. So if you wanted to download this, let's go to the download site and

4:01it'll basically see that I'm on a Mac and then just say download this one.

4:05If you're in Windows, it's also a downloader and we're okay. So basically we

4:10don't

4:11have a lot of options here. Let me see for Intel. Okay, cool. We do have an

4:15Apple Silicon. This is what I would be downloading. So just, you know, if you

4:19want to do this, download it and check it out, you can do that or you can go to

4:23an anaconda navigator and where's PyCharm? PyCharm Professional Install, right?

4:30So this is a full-fledged IDE, meaning that 18 Wheeler, that's why we're

4:34talking

4:34about does a lot of stuff here's talking mostly about web development.

4:39All right, so that's it for this video and I will see you in the next video

4:42when we

4:43jump into Visual Studio Code. See you there.

Visual Studio Code

0:00Welcome back. Alright, let's dive into Visual Studio Code by downloading it.

0:05And here is the download and you have some different options. So for me there's

0:10no silicon so I would just basically use the stable universal installer. Once

0:18you

0:18have that installed we can go over here to our desktop and we can try to create

0:23some projects here. So this is what we used before so I'm just going to exit

0:29and

0:30get a new one and I'm going to make this a little bit bigger and what I'd like

0:35to

0:35do now is create that project. So I'm going to Conda activate. Alright, so we

0:40new Conda and a Conda install and so now we have our base loader here and we

0:46can

0:46create some environments or some yeah some Conda environments. So I'm not sure

0:53if

0:53you installed it before but if you did great if not let's do that now. So we

0:58want to say Conda create and then dash dash name. Then before I finish this I

1:05do

1:05want to share this Conda cheat sheet with you and this will be linked in the

1:09skill and here you can see basically anything that you need to do. So here is

1:14Conda create dash dash name and then this is the name of the environment and

1:18then

1:18here you can install Python whatever version you want or if you leave this

1:23blanket will install the newest one the latest version that it has and then you

1:28can install other things other packages right. So if you wanted to install

1:32pandas you think you can do that here as well. So this is a really great cheat

1:39to have like Conda and list is right here Conda list will list all the packages

1:44and versions installed in that active environment whatever is in the

1:48parentheses.

1:49Okay, so we're going to create name and then we're going to say TF underscore

1:54pro which I already created but I'm just showing you how you would do that and

1:58what we want to do here is add pandas and TensorFlow and we're also going to

2:05add

2:05Jupiter like this and run that and then you'll have you can activate that by

2:11using this name so Conda activate TF underscore pro. Now let's say that you've

2:17already done that but you've and you only installed it pandas and TensorFlow

2:21but

2:21you did not install the others so what you could do there is first Conda

2:26activate

2:26and it's TF underscore pro and now that you're here if you need to install

2:35Jupiter you can say Conda install Jupiter like that and then once you do that

2:43then

2:43you can run Jupiter notebooks but we're more interested in Visual Studio Code

2:50so

2:50what we're going to do here is just make sure that we have this TF underscore

2:54pro created and have all the packages installed that we're going to use we

2:59can add more later but we have this done so now I'm going to say Conda de

3:03activate

3:05I'll do that twice all right and then clear and then boom we have a clear

3:10terminal and now we're ready to start working with Visual Studio Code. All

3:17right

3:17so this is a new window and I've already created a project but we're not going

3:22to look at that just yet let's just think of this as the first time that we've

3:25run this if you use shift command P you can get this sort of area and then you

3:31can add some different things for example you can say execute code shell

3:42command

3:42install code in the command path that's something that you want to install so

3:46you could write it like however you want to write it to get to this point so if

3:51you click on this it's going to install code in the command path and let me

3:54show you what that does once you have that done you can go ahead and close

3:59Visual Studio Code I don't even hit quit here and then what I want to do is I

4:04want

4:04to navigate to cd desktop and then inside of that desktop I want to go to

4:11TF underscore pro let's go in there now we're there and now from here I can say

4:18something like code and then period when I do that it's going to open that oh

4:25it's

4:25not working oh I know why let's open this up and install it together because I

4:31have not installed that I thought I did so it's run code or is it once it

4:41install code from there it is so shell command I'm going to click on it and now

4:49it's going to say okay and then my password all right so shell command

4:57successfully installed in path and so now I'm going to close this and then I'm

5:02going to try that again because I'm still in the terminal and I am in that

5:07correct directory so if I use code period it's going to open that up in that

5:14directory so that's something really handy to have so that's the first thing

5:18all right so before we get into anything else I want to show you what all of

5:22this

5:22is here on the side okay so first this is the file explorer and you can see

5:27here

5:27that we have the different file types and this is where you would create new

5:33folders and such and then here this is searched and you can search all kinds of

5:38things in here for missing files or certain classes and things like that and

5:43source control is really cool and this is where you could connect to you get

5:48hub repository for example and push your changes to that repository which will

5:53we will be doing quite a bit of and then here is a debugger so you can actually

5:57run this to debug this is mostly something that you would find a lot in

6:02web development and those kinds of workflows but it's also you would see this

6:06in data science as well it's very useful and so this is a debugger and then

6:10here

6:10are some extensions so let's go ahead and install some extensions now so I'm

6:16going to say Python ext for this extension so what I want to do here is

6:23install this one and this one and this one so these three that's it so don't

6:31install this one this one or this one that's my recommendation and we don't

6:36need a python environment manager because we're using a conda okay so once

6:42you install these three we can move on to the next one which is Jupiter there

6:50we go click on this and I've already installed this you can see that is

6:55installed so go ahead and install this and then once you do that we'll get into

7:01how you can actually have the best of both worlds meaning you can have

7:07something

7:07that looks just like an interactive notebook right inside of visual studio

7:11code and there's multiple ways that you can actually leverage this because it's

7:16really useful to have the iterative code cells so that you can see things run

7:22as

7:22you're working because it's common to jump back and forth right but if you're

7:26in a dot pi file it's actually not that great because you need to run the whole

7:31script but this plugin will allow us to like highlight a section and then see

7:37it

7:38run in like a virtual notebook so it's like pretty amazing stuff so let's okay

7:44definitely install this let's keep moving there's so much to install that

7:47there's all kinds of stuff so I'm gonna say dark theme okay and this is the one

7:57that I usually use and so I'm going to go ahead and install this one and once

8:04you do that you can go over here to settings and profiles not themes and I'm

8:16gonna say color theme and here you can set them up so I'm gonna say dark plus

8:22okay and then another cool thing that you can do is set up some sort of icon

8:27theme I use this material so I'm gonna install that one okay and then you can

8:35set it here or you can go down here to themes and file icon theme that's the

8:41one that I want and we're gonna use the material icon well we can use either

8:51one of these let's just use this one okay and what does that do well here it

8:56actually changes these little icons to look really cool and this is I find it's

9:00really useful to tell the difference between files and so I really like that

9:04and I like this dark theme too all right so there's really a lot more that we

9:10can install here but I mean just just a lot so take a look but I wouldn't

9:15install too many more because you can actually get some conflicts and that's

9:19actually I'm glad I said that because we go here and we go to this read me I

9:25wanted to bring this to your attention so let me show you how you can get the

9:29terminal click up here and do terminal or you can use this shortcut and here

9:34you can see that there's no base or anything like that so how do you deal

9:41with that so down here well this is a read me file but I wanted to show you

9:46that if you activate it if you said come to activate it would say base and then

9:50you can activate TF_pro or whatever name of your environment the problem here

9:57though is that it would say base and the TF_ so it was showing too so this is I

10:04went to stack overflow here let me show you this link there we go so you can

10:12see

10:12it says base and then whatever the name of that environment is so that was

10:16happening and so that can happen with conflicts so if you go down here the

10:22reason that there was like there we go as described on this page the Python

10:27extension now automatically activates the environment so it seems that the

10:32problem is caused by the automatic activation it's by that plugin so you

10:37could use this right here to copy this and basically go back to the terminal

10:42and

10:42then paste it there run it and then restart this sometimes you have to

10:45restart the computer but then it will fix that problem so that is something

10:50that can happen and this is just read me file .md for markdown where you can

10:55just write text in it all right so let me show you something really cool I'm

10:59gonna get out of here and I'm actually just going to close this just quit code

11:03completely and then I'm gonna open this folder that I have here this is the

11:08folder that we've been opening up in Visual Studio code you could just say

11:12code period because we're in that folder here in the terminal or you can grab

11:17it

11:18and just drag it in which is not the most programmatic way of doing it but you

11:23could do it that way or go back to this folder and you see that I have this

11:31workspace file if I double click on this look what happens this is really key

11:38right here you didn't really notice this but out but here is the Kanda

11:43environment which is this is pretty important this is kind of tricky let me

11:49show you let's open up the terminal okay if I click on this it shows you that

11:54it's

11:54a Kanda environment that we created it's not the base but the pro and this is

11:58exactly what we want to have if you go to terminal and go to new terminal you

12:03can see that we have that selected so this is pretty cool this is how you use

12:07these Kanda environments in the right kernel using VS code this is pretty cool

12:13and don't worry if this is a little bit overwhelming it's a lot of information

12:17we're gonna go over this again and again and again and so every time we start a

12:23skill we're going to set up our development environment you know using

12:27whatever we're using but it's going to be a review of this so it's going to be

12:30something that's not just like all this information all at once all right so

12:34what we're gonna do now in the next video is set up our challenge so I'm

12:38gonna try to get you to to to accept this challenge and make it interesting

12:44for you and well the main goal is to create a main.py file a readme.md and

12:50then once you do that you want to go to file and then save workspace as and

12:59once

13:00you do that you'll have this workspace safe and then I'm going to show you in

13:03that video the solution video how to get the proper environment and if you've

13:10already created that your own con environment is just by clicking this and

13:13selecting it really so if you do that and then you save your workspace every

13:18time you click on that workspace file it'll open this up and you'll be in the

13:22proper con environment you don't have to write anything in the terminal pretty

13:27awesome so I'll see you in that next video where we kick off the challenge

CHALLENGE 🎉

0:00Welcome back and congratulations on making it to the end of the skill and to

0:04the challenge.

0:06This is going to be awesome.

0:07Let's do this.

0:08All right.

0:09So here we have this empty page.

0:12And what we want to do in this is add some code.

0:15But first let's close this and your challenge is to create your own Kanda

0:22environment, a

0:23new one and then a new folder for your project.

0:28To navigate to that folder in the terminal and use code space period to open it

0:35.

0:35So mine is TF_PRO.

0:37Yours can be whatever you name it and then open that project using this method.

0:41That's part of the challenge.

0:42And once you do, let me actually just go ahead and do that.

0:46And once you do, you want to create a readme.

0:48And in here you can say anything like hello or like I did it or whatever you

0:53want.

0:54And then here in the main.py you're going to do what we did before in previous

0:59videos.

1:00And I'm just going to make this pretty straightforward.

1:02So you're going to add a comment here.

1:07So import pandas with alias.

1:13So I'm going to leave that as a trick.

1:15Not a trick but a challenge.

1:18And then here what you want to do is create a data frame.

1:23So this should be pretty easy but I'm going to make it even easier.

1:26So it's PD.read_csv and then in here you're going to pass in the URL.

1:36And you're going to have to define that URL up here and put it in quotes.

1:42And then you can uncomment all of this stuff and then just write the code down

1:46here.

1:46This is just comments to help you out.

1:49And then in the next video we're going to, in the solution video, we're going

1:52to, I'm

1:52going to show you how to do all of this stuff from scratch.

1:56And make sure that you are in the correct conduct environment that you created.

2:01Right?

2:02You don't want to be in base.

2:03And if you want to double check you can go to terminal and say new terminal to

2:06see if

2:06you are really in there.

2:08All right.

2:09So you got this and I will see you in the solution video next.

CHALLENGE 🎉

0:00Congrats on completing the challenge and let's take a look.

0:04So first things that we want to do here is navigate to the right directory and

0:09I can use

0:10pwd print working directory to see that I'm already in the right directory.

0:14So that's cool.

0:15So now I'm going to say code space period to open Visual Studio code in that

0:18directory

0:19and now look where we are.

0:21So let's just say that I created this and the way that I would do that is click

0:24on this

0:24plus sign and just say main.py.

0:28But it already exists.

0:29I'm not going to do that.

0:30I want to create the read me.

0:31I would also do that all caps.

0:33That's the convention read me dot MD for markdown.

0:37And then this is what we're going to do last.

0:40All right.

0:42So here let's do the first thing.

0:43So we need to import pandas with the correct alias.

0:46So import pandas as pd and we're going to define that URL here.

0:57So let me go to this place introduction to deep learning sunspots sunspot CSV

1:07grab that.

1:08Oh, I need raw first because otherwise it will not work.

1:11It needs to look like this.

1:12Then we grab that URL go back put it between the double quotes.

1:19All right.

1:20So now that we have pandas imported, we have the URL.

1:23We can say df equals pd dot read underscore CSV and just pass in that URL.

1:32And then we're going to say D we have to use print and I'll explain why print.

1:38And then here we're going to say data frame dot head.

1:44And let's just look at the first three.

1:46If you want to look at the last three, we can do that using tail.

1:50Let's not trail tail.

1:53All right.

1:54Let's save this and then now what we're going to do is execute this.

1:57I'm going to say main Python main dot hi.

2:06And there's the last three.

2:08All right.

2:09So this is how you complete the challenge except for one last thing.

2:12All right.

2:13So now that we've done this and congrats for being able to do all this is

2:16really awesome.

2:17So now what I'm going to do is I've got this set up and I'm going to make sure

2:21I'm going

2:21to go over here.

2:24I do see that we're using the right TF underscore pro conduct environment.

2:31So that's good.

2:32So now that we have it like this, we don't want to have to set it every time

2:36because

2:36you do have to click on this every single time.

2:39It's kind of a pain.

2:40So the way we work around that is now say save workspace as and then I would

2:45basically

2:45save that in whatever you finally want and then click save.

2:50I've already done that.

2:52Let me show you what the benefit of doing that is the benefit is this whenever

2:55you want

2:55to start working on your project, you just go to your project, you open up that

2:59folder

2:59and you double click on this and you're done.

3:03And you can see that you have the TF pro already selected and you're ready to

3:08go.

3:08If you wanted to run that file again, you could, but we're not going to do that

3:12.

3:13All right.

3:14So that's it for this video.

3:16And wow, we've covered a lot of information and don't worry if it's not all 100

3:21% clear.

3:21We're going to be using all of these tools in one way or another because we

3:26have to use

3:26different tools and that's what we're going to be doing.

3:29So until next time, I hope this has been informative and like, thank you for

3:32viewing.

Team training path

Turn this skill into assignable team training

This free skill is a preview of the courses your team can assign, track, and report on with CBT Nuggets.

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 TensorFlow Developer?

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