2

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.

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Your link appears to be broken. Good answer, though!
@sh0rtcircuit, sorry, we have to move the repo. I update the link
The link is broken again ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.