Everyone and welcome back to this class
in this lecture I'm going to go over a better way to install data science and machine learning libraries
for Python for Windows users.
Historically Windows users have had a lot of problems installing this stuff.
Luckily these days there is an option that makes things very painless and just as easy as they are on
Linux or Mac that is Anaconda.
In fact even if you're not on Windows you can still use Anaconda.
It's nice because it isolates your environment from the defaults provided on your system.
So for example you can have Python 3 in Anaconda but Python 2 as your system default.
When I first started these courses I wasn't keen on Windows since there were a few central libraries
that couldn't be installed on Windows without a significant amount of effort.
If at all in my view anything beyond a couple of lines in the console or clicking an install file is
too much.
And believe me some students even have trouble with that so it's good not to make things too complicated
before you can even begin the course.
Nowadays that has changed.
It's a lot easier to install things on Windows in large part thanks to Anaconda and so this lecture
is all about how to install all the data science and machine learning libraries you'll need on Windows
using Anaconda.
So in this lecture I'm going to walk you through how to install Anaconda as well as some of the libraries
you might need that don't already come with Anaconda.
You'll find that most of the common libraries such as spy and Siple are already included.
So if that's all you want to use then for you it's just a one click install
on this slide.
I'm going to give you a super short summerize version of this lecture so you don't have to walk through
the installation with me if you don't want to.
For some people that really helps since you can see it.
But if you can do it on your own feel free so number one.
Download and install Anaconda.
This is just a one click install.
It already includes some supply supply not plugged lib and pandas.
That's all we need for the stack in Python.
Linear regression and logistic regression and a few more courses.
It also comes with NLC K which is what we use for an LP and psyche learn which has some pre-built machine
learning models now even though this stuff comes by default.
You can still update them if you want so you can do Conder update an umpire for example and that will
update by number 2 install deep learning libraries.
If God Pippin's start tensor flow that's going to install tens of flow and if you want to install Karris
you have to first do Konda in stoppit which is going to update Pipp and then you can install keras using
Pipp install Khera us.
If you don't update Pipp first you might get an error.
We have a C in Teekay which is Microsoft's deep learning library.
So you do Pipp install and then the C and Teekay euro which you can get from Microsoft's website.
So I'm not posting any you are all here because the version could likely change in the future.
And so you can Google search how to install CNC K and you can get a euro just like this.
Next we have Pitre.
That's Konda and start minus see Peter.
See 2:59 pie toward.
After that we have C.A. So that's Konda and start piano or Konda install Viendo you.
If you have an Nvidia you and you've installed the Kuta tool kit already.
Number three install open a gym that's just Pipp installed Jim.
If you want to be able to play Atari games also then that's more involved so just skip to the end of
this lecture where I walk through that if you want to play and save videos using opening gym then you
also have to install FFM MPEG
So the first thing we're going to do is go over to the Anaconda Web site.
That's an icon a dot com slash download.
Scroll down to the window section and click on either Python 3.6 or Python 2.7.
Or if you're watching this lecture in the future and there's a new version.
Get that the code in my courses is compatible with both Python 2 and Python 3.
So in that regard it doesn't really matter which when you get in the lectures you might see Python to
code.
But the best way to make sure you're seeing the latest version is to get Paul inside because repo so
make sure you're always doing that because I'm constantly making new updates.
Now though Python 3 is newer There are still reasons to use Python too.
For example in your work you might use Python 2 or certain platforms like Google App Engine only support
Python too.
So if you are running a web app that means you're stuck with Python too.
It does have great scalability features so there are many good reasons to use Google App Engine if you
want to get more insight on whether to choose Python 2 or Python 3.
Just check out the appendix lecture Python 2 vs Python 3.
So now that we've downloaded the install file all we need to do is click on it.
That's what I mean by one click install you click on this.
OK a few times and everything is done.
Unfortunately I gave my username a space which kind of sucks but that's what happened.
So I'm sure some of you have a space in your username too.
So if I come across any issues at least you'll know what to do.
All right so everything's installed.
So essentially everything except that the libraries have already been automatically installed so you
don't need to manually install them Paice I buy Matlab live and as I Python or sikat learn so if you're
taking my non-pilot course or any course that doesn't use modern deep learning libraries you already
have everything you need.
So let's go into Python and make sure that's the case.
To start Python I go to the start menu type in Anaconda and then this anaconda prompt application should
pop up.
Actually it should pop up before you even finish typing Anaconda.
So we go into there and this brings up a command line terminal.
Next type in Python.
After that we can import all the libraries I mentioned earlier.
If we don't get an error that means they've been installed successfully.
So let's try something simple like generating some random numbers and making a plot
so that's a plot of random noise.
Let's make a histogram to
it so we see a normal curve just like we expect.
You can see that tensor flow is not installed which is why we get this error.
But we can install it very easily by accepting Python and then typing in Pipp install tensor flow
next.
Let's try to install carious
so we get this error.
So I looked this up and determine that we need to update PIP so let's do that by typing in Konda install
stoppit Kondo kind of works like pipin that way they are all just tools for installing stuff.
Now let's try Pippin's carrots again.
All right.
So everything works
next let's try to install and T.K. this is used in my and AP courses.
So it looks like it's already installed.
So there's nothing more to do.
Just keep in mind if we come across a library you don't care about.
Feel free to ignore it.
I find it's useful just to install everything at the same time so that when you're deep in the code
later you don't have to think about stuff like this.
So the next thing will install is C. A.K. This is Microsoft's deep learning library.
Notice how it's not part of Pipp.
So you need to Gravier your role manually from Microsoft's Web site.
Unfortunately it's a little hard to find because there are many pages that deal with how to install
the A.K. on Microsoft's Web site.
But what you're looking for is a page that has a link to a W H L file.
So copy and paste that after Pipp install this is a good example because it shows you another way you
can use Pipp by doing Pipp install and then a Yoro
next let's install Torc.
This requires us to use a custom source so we have to specify the option minus see Peter J.C one two
three.
So that's Konda install minus see.
Peter Casey 2:59 by Torc.
This is because a very nice guy called PIERGROSSI 2:59 has provided us with a version of Pi torch that
works on Windows and once that's all done we can verify that they've been installed correctly by going
back to Python.
All right.
So tensor flow works.
K works
see and T.K. works
and torch works
next letters and stuff.
Yanno Viendo has historically been pretty difficult to install on Windows but nowadays that's not the
case.
So if you go to their Web site you'll see a bunch of instructions.
If you don't want to use the GPS you or you don't have a GPS you then the instructions will be very
easy.
I don't ever keep you on this machine so I'm going to do the easy version.
Keep in mind that Viendo is really great for learning purposes.
So it's totally fine.
Even if you have AGP you to just install the CPQ version for now and then use the GPU version of tensor
for now.
I ended up upgrading MKR service and lib Python since that's what they told me to do on Vienna's Web
site.
But it looked like these were already installed.
In fact updating MKR service gave me an issue later.
So we'll have to fix that.
So if you want to install CNO for you only That's kinda install CNO if you want to install Viendo for
the cheap you then do Konda install it.
Yanno you
now let me go into Python and check if C.A. works.
So we get an error because of this MKR service thing that I mentioned earlier.
So let's set this environment variable.
It's telling me to set.
By the way this is great to know if you don't yet know how to set environment variables on Windows.
We can also check that it works by using the echo command.
So let's try that again.
Let's do a simple example of adding two numbers MVNO.
Just to make sure everything's working.
If you want to do something even more complicated you can run this script from replaying part 2 which
doesn't require any external data set.
So just go over to the folder and in class to type in Python.
Grid search.
Hi.
So that's going to look for hyper parameters using cross-validation.
Now in this last section of this lecture we're going to talk about reinforcement learning when we started
studying reinforcement learning.
There is yet another library will need to install called Open a gem.
If you don't plan on learning reinforcement learning you can skip this part of the lecture.
This has also historically been very difficult but luckily the open source community has put in the
work.
So you don't have to.
You're welcome to read through the get her issue on this if you want but I'm going to just do the simplest
thing that works.
So let's first do Pippin's Stajan
now the second command is a bit longer.
So let's go to the actual get her issue and copy and paste the command.
The easiest way to get there is just to go to Google and type in install open gym windows anaconda or
something along those lines.
So let's paste that in.
And notice how it feels since I haven't yet installed it.
So we can install it by doing Konda install yet.
Now let's try it again.
Unfortunately this fails again because we need gcc which is a C compiler.
Now one way to get gcc is to do Konda install MTU w 64 toolchain but unfortunately I tried this and
it also doesn't work.
In fact I think this toolchain was installed already.
So I tried quite a few things that didn't work.
So in order to save you some time I'm going to recommend you only try this stuff on this page.
If everything else doesn't work for you.
So it worked for me was to just grab the pre-compiled binary directly.
Now in order to do that you want to go to could you please get help reports directly.
So that's this you're out here.
Get up Dotcom's slash cordiale slash Atari dash pie slash releases.
Next you'll want to download the w h file that matches your environment.
So I have Python 3.6 on a 64 bit installation of Windows.
So this is a file I want.
Luckily we already discussed earlier in this lecture how to install a w h file.
That's just Pipp install and then the path to the file.
So let's do that.
Now we can test our installation by running a script that requires an Atari game.
So let's see the over two or two and then Atari.
And now let's run dequeue in underscore TFT up-I
cool so everything's good.
Now the final thing we want to do for open edgin is if you want to play a video or save a video you
want to install FFM pag so to do that you want to type in Konda install mynahs see mento F-F MPEG.
Once you've done that you can go to the card pull folder and type in Python save a video PI and this
will run a script that will play the card pool game show a plot and then save a video
and of course you can also play this video by just navigating to the file and clicking on it.
So for now that's everything.
If I need to add new libraries or updates to this lecture they will be appended at the end.