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 and 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 essential 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 Num pi and Saibai 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 summarized 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 no one download and install Anaconda.
This is just a one click install it already includes num pi zip by map plat lib and pandas.
That's all we need for the numbers stack in Python.
Linear regression and logistic regression and a few more courses.
It also comes with NRT K which is what we use for MLP 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 kinda update num pi for example and that will update num by number to install deep learning
libraries.
You've got pip install tensor flow that's going to install tensor flow and if you want to install cameras
you have to first do kinda install Pip which is going to update Pip and then you can install cameras
using pip install carrots.
If you don't update Pip first you might get an error X. We have a S.A. A.K. which is Microsoft's Deep
Learning library so you do pip install and then the S.A. K you Earl 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 just google search how to install C A.K. and you can get a euro just like this.
Next we have pi talk.
That's pip install Minus C. Peter Gacy one two three pi torch after that we have a..
So that's kinda installed V.A. or kind installed V.A. pie GP you if you have an end video GP you and
you've installed the Cuda tool kit already
number three install open a gym that's just pip installed gym 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 you through that if you want to play and save videos
using open AGM then you also have to install f f MPEG
so the first thing we're gonna do is go over to the anaconda Web site.
That's Anaconda dot com slash download.
Scroll down to the window section and click on either Python three point six or Python two point seven.
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 one 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
pull inside the course 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 2.
For example in your work you might use Python 2 or a certain platforms like Google App Engine only support
Python 2.
So if you're running a web app that means you're stuck with Python 2.
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 versus 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 hero.
Okay a few times and everything is done.
Unfortunately I gave my user name a space which kind of sucks but that's what happened so I'm sure some
of you have a space in your user name 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 the deploying libraries have already been
automatically installed so you don't need to manually install them by side by map live.
And as I Python or cycle learn so if you're taking my name pi course or any course that doesn't use
modern deep learning libraries you already have everything you need.
So let's go into AI python and make sure that's the case to start a python.
I go to these 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.
You just type in AI Python
after that we can import all the libraries I mentioned earlier.
If we don't get an error that means that 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
and you can see that tensor flow is not installed which is why we get this error but we can install
it very easily by exiting I python and then typing in pip install tensor flow
next let's try to install Kerry's
so we get this error.
So I looked this up and determined that we need to update Pip so let's do that by typing in Canada install
Pip kinda kind of works like pip in that way.
They are all just tools for installing stuff.
Now let's try pip install carrots again
all right.
So everything works
next let's try to install an LTE K this is used in my A.P. 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. A.K..
This is Microsoft's Deep Learning library.
Notice how it's not part of Pip.
So you need to grab your realm 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 C 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 pip
install.
This is a good example because it shows you another way you can use Pip by doing pip install and then
a you URL
next let's install pi talk.
This requires us to use a custom source.
So we have to specify the option minus C. Peter Gacy one two three.
So that's kinda install minus C. Peter Gacy.
One two three pi talk.
This is because a very nice guy called Peter Gacy one two three has provided us with a version of Patrick
that works on Windows and once that's all done we can verify that they've been installed correctly by
going back to a Python
all right.
So tensor flow works Kerry's works
and l T.K. works
C and T.K. works
and torture works
next.
Let's and stuff.
Yano V.A. has historically been pretty difficult to install on Windows but nowadays that's not the case.
So if you go to their website you'll see a bunch of instructions.
If you don't want to use the GP you or you don't have a GP you.
Then the instructions will be very easy.
I don't have a GP you on this machine so I'm going to do the easy version.
Keep in mind that V.A. is really great for learning purposes so it's totally fine.
Even if you have a GP you to just install the CPE you version for now and then use the GP you version
of tensor flow.
Now I ended up upgrading MPL service and lip Python since that's what they told me to do on Vienna's
website but it looked like these were already installed.
In fact updating MPL service gave me an issue later so we'll have to fix that so if you want to install
V.A. for CB you only that's kinda installed V.A. if you want to install V.A. for the GP you then do
kinda install piano pi GP you
now let me go into a python and check if piano works
so we get an error because of this MPL 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 I worked by using the echo command
so let's try that again let's do a simple example of adding two numbers in piano just to make sure everything's
working.
If you want to do something even more complicated you can run this script from deplaning Part 2 which
doesn't require any external data set so just go over to the folder and in class 2 and type in Python.
Grid search that pie 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 start studying reinforcement learning.
There is yet another library we'll need to install called Open a gym.
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 github issue on this if you want but I'm going to just do the simplest
thing that works.
So let's first do pip install Jim
great So that worked.
Now the second command is a bit longer.
So let's go to the actual GitHub issue and copy and paste the command the easiest way to get there is
just to go to Google and type in install open AGM windows Anaconda or something along those lines
so let's paste that in
and notice how it feels since I haven't yet installed yet so we can install get by doing condo install
yet.
Now let's try it again
unfortunately this fails again because we need DCC which is a C compiler.
Now one way to get GCSE is to do condo install M2 w 64 tool chain but unfortunately I tried this and
it also doesn't work.
In fact I think this tool chain 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'll want to go to control his GitHub repo directly so that's this your URL here GitHub dot com slash
cordially slash Atari dash pi slash releases next.
You want to download the w h file that matches your environment so I have Python three point six on
a 64 bit installation of Windows.
So this is the file I want.
Luckily we already discussed earlier in this lecture how to install a w h file that's just pip 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 over to our L2 and then Atari.
And now let's run Daegu n underscore t after PI
call so everything's good.
Now the final thing we want to do for open again is if you want to play a video or save a video you
want to install FSM pig so to do that you want to type in Canada install minus C men Po f f MPEG
once you've done that you can go to the capo folder and type in Python and save a video da pi and this
will run a script that will play the carpool game show a plan 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.