DEV Community

Cover image for Make sure the python env is always running in cloud shell.
Akshay Rao
Akshay Rao

Posted on • Edited on

Make sure the python env is always running in cloud shell.

Introduction
Hi, I am Akshay Rao, recently working with python in AWS cloud shell every time, i had to activate the python env whenever open the cloud shell. This was annoying me, so found a solution.
Pre-requisites

AWS account

Let's start

  1. Login to the AWS account and open the cloud shell form the console. Image 1
  2. Create a python env in it. everytime i had to execute the source ~/.venv/bin/activate to activate the py env. Image 2
  3. Now we can put this command in the ~/.bashrc file and it will run this command when ever the cloud shell is opened. Image 3
  4. to test open new tab or just source the bashrc file. Image 4
  5. from now on we dont need to remember to activate the py env before working.

Thank you

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (1)

Collapse
 
oc profile image
Xiaoli Wei

cool~ and just only used for AWS shell? another is working fine as well? thanks

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay