A.Bux
A.Bux

Reputation: 109

How to install dependencies to Azure Pipeline Python

Hi I'm trying to build a pipeline using python in Azure. The problem is when I build the pipeline I'm getting the error "Install Python dependencies."

The official documentation talks about building a requirements.txt that uses pip to install the dependencies. https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/python?view=azure-devops

The problem is I don't know how to make it so that the pipeline will read the requirements file and automatically install those dependencies before it reads the .py file.

These are the dependencies I need to install

pip install pandas
pip install openpyxl
pip install tkinter

I'd be grateful for any help you can provide.

Upvotes: 2

Views: 10728

Answers (1)

Beliaev Maksim
Beliaev Maksim

Reputation: 1569

This does not require a pipeline.

Instead, you leverage existing CMD, Bash or Powershell tasks. You should create a file with all your requirements. Then, you just specify the python commands to run in your pipeline.

E.g. python -m pip install -r requirements.txt

Example:

Have a look at how I built a pipe in my project as a reference.

Note:

I use a virtual environment not to pollute anything outside my pipeline.

Upvotes: 3

Related Questions