Resource mentioned in this lesson: Managing Multiple Python Versions With pyenv
Setting Up Your Virtual Environment
00:00 In this lesson, you’ll be setting up your virtual environment. Now, a note that at the time of recording, the most recent Python version that works with the packages you’ll be installing is Python 3.13.
00:15
In case you have a Python version that doesn’t work with the packages you’ll be installing, then please consider setting up a virtual environment with a specific Python version, a version that works, obviously. And you can use something like pyenv or uv to do that, and I include a link to a Real Python tutorial that explains everything in detail. Now, the instructions to set up and activate your virtual environment are as shown on the screen.
00:44
So for Linux and macOS, you use python -m venv venv/ to create your virtual environment called venv, and then you activate that virtual environment using the instruction source venv/bin/activate, all in lowercase.
01:07
And again, a note that for some Linux distros, you’ll need to use python3 as opposed to python.
01:15
For Windows PowerShell, then you use python -m venv venv, and to activate that virtual environment called venv, you then type venv\Scripts\activate.
01:32
So now that your virtual environment is set up and activated, I can show you how to use the .env file to make your environment variables persistent.
01:43
That I’ll cover in the next lesson. But please remember that this lesson is optional, so if you’ve made your key persistent without using the .env file, or if you choose to keep your key temporary, you can go straight to the lesson that covers installing openai.
Become a Member to join the conversation.
