--- title: "Python Virtual Environments: Video Tutorial" date: "2023-03-30" categories: - "python" coverImage: "PythonVirtualEnvironments-1.png" --- # Python Virtual Environments: Video Tutorial This video shows you how to create virtual environments in Mac/Linux/Windows. We also include a demo of a new feature in VS Code that works great with them, so you don't have to set up the interpreter. Note that the commands you need, the slides from the video, and additional resources are listed below (under the video). https://youtu.be/b\_j-iX0caHA ### Virtual Environment Commands (Mac and Linux) ```bash # Create the environment python -m venv venv # Activate it source venv/bin/activate # Use it pip install ... python ... # Deactivate deactivate ``` ### Virtual Environment Commands (Windows) ```bash # Create the environment python -m venv venv # Activate it venv/Scripts/activate # Use it pip install ... python ... # Deactivate deactivate ``` ## See Also: - [What Is a Python Package](https://codesolid.com/what-is-a-python-package/) - [Conda vs. Pip, Pyenv and Venv](https://codesolid.com/conda-vs-pip/) [Slides from the Video](https://codesolid.com/wp-content/uploads/2023/03/VirtualEnvironmentsSlides.odp)[Download](https://codesolid.com/wp-content/uploads/2023/03/VirtualEnvironmentsSlides.odp)