How to install dependencies to Azure Pipeline Python

Viewed 1812

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://docs.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.

1 Answers

you just create a file with all your reqs. It has nothing to do with pipeline

then you just specify which commands to run in your pipeline, it is just pure CMD.exe/powershell/bash syntax. Where in few words you call python -m pip install -r reqs.txt

Have a look how I built a pipe in my project as a reference: https://github.com/ansys/pre-release-installer/blob/v3.0.1/pipelines/azure-pipelines.yml Note: I use virtual environment not to pollute everything outside my pipe

Related