Hi, Ron, welcome back.
In this lecture, we're going to be setting up a virtual environment, and the main reason to keep it
simple of why we're using a virtual environment is to use or to reduce the chance of having conflicts.
And this is going to really apply to any Python version, any dependancy version, library version.
So, for example, where we're going to be working with Python three point seven.
But on my machine, I have multiple Python versions for many projects, or maybe in this project it
requires to use a specific version of a library.
You know, maybe we need to use version scrapie compared to beautiful soup y or in another project you
need to use a different version of scrapie or selenium.
This is just examples.
We're going to using Python three point seven and the most recent scrapie and beautiful soup versions.
But setting up this virtual environment will reduce conflict from other environments that you have or
from your base or environment.
So to get started, we can launch the Anakonda Navigator.
I'm going to be working from the terminal.
I think that's something that we want to become more familiar with or comfortable with working directly
from the terminal, because it's really useful when debugging, testing, just running any kind of specific
command.
But you can also launch the any kind of navigator from the icon that you downloaded.
Remember, on Mac and Linux, you'll be using the terminal on Windows, you'll be using the anakonda
prompt.
So let's run Anakonda Navigator and I'll resume as soon as that is up.
OK, so there we have it in a kind of navigator, this is the main interface that you're going to be
looking at and this is the base or route environment.
So what we can do to set up our virtual environment is to go to the environments tab.
And you're going to see in mine yours.
If you just installed the Anakonda Navigator, it's only going to have the Basar route.
But I work with for really any type of project and I'm working with I set up a virtual environment because
it helps minimize those issues between dependencies.
And this is really something that's agreed on across many domains in data science, MLA programming.
It helps on the control of those specific versions.
So we can go to environments.
You can go down to click the create here.
We could give it a name so you can really call it any name that you want.
Let's go with Web Screwtape and we're going to be using Python three point seven.
From here, just click on Create and let it load.
And there you have it, you have created your virtual environment.
Pretty simple process.
This is going to show you the libraries are coming preinstalled within the environment.
But if you go to not insult, you could also use all.
But let's go to not install.
And as an example, we're going to be working with scrapie, so let's go once this load's, we can go
to script and you can see you can install it right now.
Now, it's not important.
If you want, you can install it.
We're going to be installing and going through the steps later for our specific library.
So no issue.
You can also use Wi-Fi, but KONDA is a great tool to use as a package manager.
But this is what I want to take away.
Really, really simple.
Process of setting up a virtual environment, and there's a few more commands that we can work with,
so I'm going to bring back open the terminal.
Let's do a new terminal and we can actually check by using the commands QandA environment list.
And this is actually going to list all the environments that we have installed.
You'll see more for mine just because I have other environments already set up.
But here we go, web scrape.
That's what we want now on Mac and Linux, you'll be using the source active web scrape.
You want to use the name of the environment that we created on Windows.
You will just need to use actively so you can just run.
This is in a kind of prompt on Windows, on Mac and Linux.
Source activate web scrape.
And that will activate we'll be working directly from our environment, you can run Anakonda Navigator
from here.
We already have one instance loaded, but we can now install specific versions directly from the terminal
into this virtual environment.
And if you want to check, you can also use QandA list and it's going to install or excuse me, it's
going to display the versions or the library versions that are within this virtual environment.
So really powerful tool, really great setup.
I highly recommend it for any project that you're working with and for the purpose of this course,
we're going to be working with our Web scrape environment.
OK, also work and see you in the next video.