Project Documentation: Creating a Python Virtual Environment

Nicole Ann Hargrove
Python in Plain English
2 min readMay 9, 2021

--

This is another project from my Level Up In Tech AWS DevOps Boot Camp. Creating Python Virtual Environments.

Scenario

Developers often run into the issue of having multiple Python projects that have different requirements but must coexist. This is no different for Pythonistas. Virtual Environment (venv) module in Python was created to solve this problem.

The Virtual Environment (venv) module supports creating lightweight “virtual environments” with their own project directories which would isolate them from system directories and have its own independent set of installed Python packages in its project.

To learn more about venv, check out Python documentation 12. Virtual Environments and Packages.

In this tutorial, your team has come to you to set up a Python Virtual Environment on a Ubuntu 20.04 EC2 instance using the AWS CL2.

Tasks

To accomplish this scenario, we will execute the following:

  • Create an IAM user and grant programmatic and console access.
  • Create a key pair.
  • Create an EC2 instance using the AWS CLI2.
  • Refresh updates and upgrade all packages on the instance.
  • Configure and activate the Python Virtual Environment.
  • Test the Python Virtual Environment.
  • Clean up the AWS Environment.

Download Hands-On Guided Walk Through of Python.pdf from my Google Drive.

Remember that sharing knowledge is a superpower and keep learning! Please feel free to post your feedback.

More content at plainenglish.io

--

--

20+yrs of IT Industry expertise from working in and with global corporations in Cloud, Integration and Digital Experiences domains as Solutions Architect.