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

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (1)

Collapse
 
oc profile image
Xiaoli Wei

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more