Azure Pipeline fails with conflicting dependencies

Viewed 96

I have created an Azure function and I am trying to build a Azure pipeline. The pipeline fails at install application dependencies with the below error.

ERROR: Cannot install -r requirements.txt (line 8) and azure-storage-blob==2.1.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested azure-storage-blob==2.1.0
    azure-storage-file-datalake 12.7.0 depends on azure-storage-blob<13.0.0 and >=12.12.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict.

Below is the code in the install dependencies.

python -m venv worker_venv
source worker_venv/bin/activate
pip install setuptools
pip install -r  requirements.txt

In my requirements.txt file the azure-storage-blob version is 2.1.0. Should I remove the version part in the requirements.txt file and trying running the pipeline. Is there any other way to fix this issue.

Thank you.

2 Answers

I just removed the version in the requirements.txt file and it was successful.

Should I remove the version part in the requirements.txt file and trying running the pipeline. Is there any other way to fix this issue.

Yes, of course you have other way to fix this issue. But you need to make sure your code is backward compatible, if your code must be based on azure-storage-blob version 2.1.0, then you can't use azure-storage-file-datalake version 12.7.0.

If your code is compatible with 'azure-storage-blob<13.0.0 and >=12.12.0', then you can specify any version within this range in the requirements.txt file.

For example, you can do this:

requirements.txt

azure-functions
azure-storage-blob==12.12.0
azure-storage-file-datalake==12.7.0

Now your direct remove version is valid because the current latest version of azure-storage-blob is 12.12.0, which can meet the dependency requirements of azure-storage-file-datalake 12.7.0:

https://pypi.org/project/azure-storage-blob/12.12.0/#history

But if you use the 12.7.0 version of azure-storage-file-datalake, you will still have version conflicts in the near future. Because if you do not specify the version number, the pip tool will install the latest version by default. If the latest version of azure-storage-blob is greater than or equal to 13.0.0 in the future, you will encounter an error again.

Related