So one important recommendation before going into the specifics of the practical part of the program,
use virtual environments.
This is our recommendation.
What are virtual environments?
A using virtual environments allows us to encapsulate the versions of Python and the modules we use.
So using virtual environments is a way to separate what you are going to do for your LM applications
from the rest of the things you have in your computer.
And this is important because it is going to prevent, uh, from contaminating ourselves with the version
of Python or other global installed modules.
And it's also going to prevent us from contaminating the global environment with our own version of
Python or the modules we have.
Uh, or we are going to install.
So it's just a.
A way to separate everything you are going to do for your applications with the rest of the things you
have in your computer.
And this in some cases is very, very, uh, useful because it is going to avoid conflicts, because
in some cases, for example, if you are a mac user, you are going to have a default version of Python
installed with your Mac.
And you may have, you know, different things on top of that, different applications or whatever running
on top of that Python version.
And if you install an updated version of Python, you know, in order to build your LM applications,
this may have conflicts with the one you have.
Well, it can be very messy and it's very simple to create, you know, virtual environments.
And it's going to prevent you a painful, uh, situations.
So it is not necessary but is advisable.
It can save you headaches, I mean, an old version of Python installed on your computer, or having
other projects that use older versions of the modules you are going to to use.
If you are already familiar with the virtual environments A or already have another system installed
to manage this such Anaconda or Miniconda, you can ignore the following tips.
If you are not familiar with virtual environments, you, um, probably have the best option with Pyenv.
Pi env is a free framework you can install in your computer, and it will help you to create a virtual
environment for each of your projects.
So just in case, if you are using Anaconda or other similar tools and you want to use a pi env no pi
dev here you see this?
This is a typo.
It's not pi dev is pi env.
So if you want to use pi env to create a virtual environment and you have other platforms like Anaconda
or Miniconda running in your computer already, you will need to deactivate the Anaconda environment
first with this, uh, command conda deactivate.
Why?
Because Anaconda by default is going to create virtual environments for you.
So this this can be a conflict with pi m.
To install Pyenv.
The best thing you can do is you go to ChatGPT and ask how to install Pi in my computer, and it's going
to be super easy and super fast for you to solve it.
In short, what are you going to do first?
If you are on Mac, you will need to have homebrew.
Homebrew is the tool that is going to help you install other things.
On top of homebrew.
You are going to install first a couple of dependencies and then pi env.
Now pi dev.
This is a typo you are going to install is pi env.
Okay, so once you install pi env, you will need to update the configuration file of your computer.
And this is the bash or the this other file with this super strange name.
And the best thing you can do is to follow the instructions of GPT.
There.
It's going to tell you open the file, include this line there and that's it okay.
So do that.
Usually safe to restart terminal as ChatGPT will tell you.
And then once you have pi env install you are going to decide what versions of Python you will want
to have in your computer in order to choose among them, you know, for your different projects.
In my case, I installed the version 311 four.
I want to go to the 312 I.
I am happy with the 311 four version of Python, so I install that and restart the terminal.
Once you have that you will need to install pi env virtualenv.
And with that ready you can create a virtual environment.
So the first thing you have to do is pi env virtualenv init.
Then you restart the terminal.
And then in order to create the virtual environment you will go to the project directory.
You will create a virtual environment.
Uh.
This way.
So Pyenv is the command virtual environment.
This is the version of Python you want to have installed in your build environment.
And this is the name of your virtual environment, whatever you want.
Okay, this is the name that you are going to choose.
You activate the virtual environment with this, uh, command.
Remember that this is going to be the name you choose.
And once you have the virtual environment, you will see that in your terminal you are going to have
the name of your environment and in parentheses.
And there it means that you are right now in your new virtual environment.
And then you need to start installing the different software you want to have there.
So in our case we are going to install and chain.
We are going to install Jupyter and we are going to install Python.
And this is important because this is going to be necessary for us to have the hidden env file for our
passwords and API keys, etc., etc..
Right.
So.
If you are not familiar with terminal, don't worry, we have a chapter coming for for that.
So once you have a pi env installed, you normally will will create a different virtual environment
for each of your professional projects.
And in the case of the projects included in this course, if you want, you can create a different virtual
environments for each of them.
Or you can have the same virtual environment for all of them.
Why?
Because we are going to use the same version of Python and the same version of the modules.
So, uh, then being in a virtual environment, you don't contaminate it with other elements in your
computer.
Okay.
So that's it about the virtual environment.