How to use python virtual environment in a buildplan

Paul Moors February 1, 2024

Has anyone succesfully tried to use python virtual environments (venv) inside of a buildplan in Bamboo?

I'm curious how this can be done.
Looking forward for your help

2 answers

0 votes
Reese
Contributor
February 10, 2024

I just run Docker in Docker for bamboo agents, for which you can run/execute a virtual env, if you wanted. But not necessary since it is a one-time env already.......

 

0 votes
Shashank Kumar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 2, 2024

Hello Paul,

 

Welcome to Atlassian community

Bamboo only uses "Shell" and "/bin/sh or cmd.exe" for executing scripts. I doubt about running venv inside plans. 

Use the below workaround:

  1. Keep your python script in some file or some location.
  2. In the Bamboo Script Task use the following command to invoke the python script:
    python <file-path>/file_name.py

 

Also, ensure that you have the python installed as a capability on the agent which will run this build.

Regards,

Shashank Kumar

**please don't forget to Accept the answer if your query was answered**

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events