The 2nd lesson I'd teach anyone learning Python π will be about using Virtual Environments.
Surprisingly, I've found out that many developers learn about this well into their careers (like I did.)
Here is everything you need to know about Virtual Environments:
π§΅π
In short, Virtual Environments let you deal with dependencies. Basically, these are the libraries that your code needs to function.
(Who remembers "dll hell" back in the day when working with Microsoft products? If you don't, Google the term.)
π
Imagine that you are building your first Python project. You want to load the content of a URL from your code, so you install the "requests" library.
Easy peasy to do using "pip install requests"! See attached image: version 2.24.0 is installed.
π
You finish your project, and all it's good and dandy!
But then, a month later, you decide to work on your second project. It also needs the "requests" library.
The latest version is not 2.24.0 anymore. Now version 3 is available! That's the one you want to use!
π
So, what do you do?
You could upgrade your system to version 3, but then you'll be potentially breaking the first project you built that depends on 2.24.0!
Do you imagine this happening on a server with many more applications running?
π
Obviously, we need a way to deal with this, so enter virtual environments.
This first step for every new project is to create a virtual environment for it.
Some people have a central location where they store all of these. I prefer to store them in the project folder.
π
Using the built-in "venv" module in Python3 we can create a new virtual environment. In this case, I'm creating it inside the project folder.
Then, using "source" I can activate this environment.
At this point, we have full isolation for our project.
π
Ar this point, if we install any libraries, they will be installed within the environment we are in, and will never mess with the libraries installed at the system level.
This is great!
(Make sure you add the .venv folder to .gitignore.)
π
This covers the basics of why you want virtual environments in your life.
If you want to get further, take a look at @realpython's "Python Virtual Environments: A Primer" article.
1. Mojo π₯ went open-source 2. Claude 3 beats GPT-4 3. $100B supercomputer from MSFT and OpenAI 4. Andrew Ng and Harrison Chase discussed AI Agents 5. Karpathy talked about the future of AI
...
And more.
Here is everything that will keep you up at night:
Mojo π₯, the programming language that turns Python into a beast, went open-source.
This is a huge step and great news for the Python and AI communities!
With Mojo π₯ you can write Python code or scale all the way down to metal code. It's fast!
The best real-life Machine Learning program out there:
"I have seen hundreds of courses; this is the best material and depth of knowledge I've seen."
That's what a professional Software Engineer finishing my program said during class. This is the real deal.
I teach a hard-core live class. It's the best program to learn about building production Machine Learning systems.
But it's not a $9.99 online course. It's not about videos or a bunch of tutorials you can read.
This program is different.
It's 14 hours of live sessions where you interact with me, like in any other classroom. It's tough, with 30 quizzes and 30 coding assignments.
Online courses can't compete with that.
I'll teach you pragmatic Machine Learning for Engineers. This is the type of knowledge every company wants to have.
The program's next iteration (Cohort #8) starts on November 6th. The following (Cohort #9) on December 4th.
It will be different from any other class you've ever taken. It will be tough. It will be fun. It's the closest thing to sitting in a classroom.
And for the first time, the next iteration includes an additional 9 hours of pre-recorded materials to help you as much as possible!
You'll learn about Machine Learning in the real world. You'll learn to train, tune, evaluate, register, deploy, and monitor models. You'll learn how to build a system that continually learns and how to test it in production.
You'll get unlimited access to me and the entire community. I'll help you through the course, answer your questions, and help with your code.
You get lifetime access to all past and future sessions. You get access to every course I've created for free. You get access to recordings, job offers, and many people doing the job you want to do.
No monthly payments. Ever.
The link to join is in the attached image and in the following tweet.
The link to join the program:
The cost to join is $385.
November and December are the last two iterations remaining at that price. The cost will go up starting in January 2024.
Today, there are around 800 professionals in the community.ml.school
Live sessions and recordings:
Sessions are live, and I recommend every student to attend if they can.
But we also record every session, and you get access to the recordings. You can watch them whenever you want.
We also have 2 office hours. They are optional but a lot of fun!