#100DaysOfCode in Python Transcripts
Chapter: Welcome to the course
Lecture: Bob's setup

Login or purchase this course to watch this video and the rest of the course contents.
0:00 I'm using Anaconda for this course, a pre-bundled, Python distribution widely used in the Data Science community.
0:09 And it comes with a lot of packages already. You're not required to use this distribution. You can also pip install my requirements,
0:17 which we will see in a bit. You can download the full version here. We recommend that you use 3.6.
0:23 Really no reason to start a new project in Python 2 anymore. You can also install Miniconda, which is a smaller version,
0:31 which only includes the base packages. And, mainly, what you need to know is for almost all the lessons, I will be using
0:40 Jupyter Notebooks, which is a great way to experiment with Python code and more in the browser. It's a great tool to both teach and learn Python.
0:50 You can try it out if you want to play a little bit at this point by going to try.jupyter.org, but I encourage you to install it
0:58 to follow along with my lessons. To install it, again, the recommended way is to use Anaconda, but you can also use pip install jupyter,
1:08 and that should get it as well. And let me show you that quickly. So, first I need to clone the 100 Days of Code repo. You cd into that.
1:16 At this point you really want to make your virtual environment to work on the project's requirement in isolation to not mess up your global space.
1:25 And in every lesson, I have a video how to pip install the requirements for that lesson, but I also
1:30 have 'em all wrapped together in a requirements file. So, for all the notebooks, you need Jupyter; and ipykernel, which I will explain why in a bit;
1:42 and then I listed out the requirements for each lesson. There are various ways to make a virtual environment.
1:48 The classic way is to use pyvenv built in module. You can also use pipenv, the new way, which should be perfectly fine. And Anaconda comes with Conda,
2:00 a utility to manage environments as well. However, I am used to virtualenv, just the classic one. So, in this course I am making a virtual environment
2:10 with this alias: virtualenv -p, pointing to the Python binary that comes with my Anaconda installation, and the name of my virtual environment.
2:18 So, let's run that now. And then you have to activate it. And that's what I'm doing, that a lot I have another alias,
2:26 ae, and now I'm in my virtual environment, where I don't have anything installed. At this point, you can just do it video by video,
2:35 but if you want to have all the packages up-front, you can do pip install -r, requirements/requirements, and that might take a bit because
2:44 it's not only pulling the dependencies, but some of the dependencies have other dependencies.
2:49 With that done, you can launch a Jupyter notebook like this. And you can go in today's and do any lesson. For example, Selenium.
3:03 And you can open the notebook like this, and you can follow the lesson. And you see that the notebook discovered my virtual environment.
3:16 If that is not the case, you might have to tweak it a little bit, and that's why I pip install ipykernel and Tornado was pulled in as well.
3:25 That should have been enough. If that's not the case, you might have to run iPythonkernel install <username> <projectname>
3:33 And this will be venv, or the name of the virtual environment. And then back to the notebook. You should have the kernel, venv,
3:40 or whatever you named the virtual environment, here, and you can switch to that, but I already have it here. So, then your dependency should work.
3:47 It's in your virtual environment and you can follow along with the lesson and make any modifications in the code
3:53 and experiment and that's how you learn.


Talk Python's Mastodon Michael Kennedy's Mastodon