To be able to send an email from the Raspberry Pi with Python.
We are going to use a Python module, and the module that we will use for this course is called Jag
mail.
So what you can do, for example, is you open a shell here in the terminal and you can do import jag
mail.
So y a and then g mail.
And you should see this.
So I press enter.
You should see an error okay.
Module not found error because well this is not part of the core modules that are already built in with
Python.
This is an external module you have to install by yourself.
So the first thing I want to show you we're not going to use that.
But if you go on tools here in Thonny and manage packages then here you can search for Jag mail okay.
Click on search.
You will find this one here okay.
And you might try to install it from here.
But you will see you will get an error okay.
So we're going to get the same error in the terminal.
I'm going to explain to you how to fix that.
So let's go to the terminal.
Let's install the module from the terminal instead I'm going to do clear here and how to install a Python
module.
Well you have the pip three command.
And you also have the sudo apt install.
And then you can do Python three dash the module name.
The thing is jag mail.
So if I do YAML jagmal here, Jagmal is actually not available with apt here.
So sometimes it's the case and you cannot install it with apt.
Okay, that would be the best choice, but it's not available.
So we are going to use Pip3 install and then Jagmal I press enter and you see we have an error here.
So if you don't have an error if it works then all fine.
But you might have this error that says that the environment is externally managed, etc. etc. and if
you remember, I showed you this error before and you can add this, you can add brake system packages.
So you add this option after the command.
So here I'm going to use the up arrow key to come back to the command.
And then space.
And I'm going to type this brake system packages okay I press enter.
And now you see it is going to work.
So it's going to download stuff and install stuff okay.
Here.
Well actually I already installed an uninstall it before.
So it's using the cache.
But for you it's going to download some stuff and you see successfully installed Jagmal.
So if I go back here and if I use the up arrow to import Jagmal again, you see that now it's working
because we don't have any error.
Great.
And now that we have installed this module we can use its functionalities.