Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install azure-cli and ansible azure collection at the same time #1779

Open
Klaas- opened this issue Dec 7, 2024 · 5 comments · May be fixed by #1781
Open

Install azure-cli and ansible azure collection at the same time #1779

Klaas- opened this issue Dec 7, 2024 · 5 comments · May be fixed by #1781
Labels
question Further information is requested work in In trying to solve, or in working with contributors

Comments

@Klaas-
Copy link
Contributor

Klaas- commented Dec 7, 2024

SUMMARY

#1138 has come back, with latest git version I can not install azure-cli because of conflicts.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

requirements.txt

ANSIBLE VERSION
not applicable
COLLECTION VERSION
Git commit 8b2b474700f42c0b87ee5eb81d3747bebd8cf1d8 (latest commit in dev branch at the time of this bug report)
CONFIGURATION
not applicable
OS / ENVIRONMENT
  • Fedora Linux 41 (Workstation Edition)
  • Python 3.13.0
STEPS TO REPRODUCE

python -m pip install -r requirements.txt azure-cli==2.64.0

EXPECTED RESULTS

Install azure cli and all ansible azure collection requirements

ACTUAL RESULTS
[...]
INFO: pip is looking at multiple versions of azure-cli to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install azure-cli==2.64.0 and azure-mgmt-apimanagement==4.0.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested azure-mgmt-apimanagement==4.0.1
    azure-cli 2.64.0 depends on azure-mgmt-apimanagement==4.0.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 to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

@Klaas-
Copy link
Contributor Author

Klaas- commented Dec 7, 2024

Diff to make it work in the direction of downgrading pinned versions:

diff --git a/requirements.txt b/requirements.txt
index fd6953f..f248004 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,46 +6,46 @@ azure-cli-core==2.64.0
 azure-common==1.1.28
 azure-identity==1.19.0
 azure-mgmt-authorization==4.0.0
-azure-mgmt-apimanagement==4.0.1
+azure-mgmt-apimanagement==4.0.0
 azure-mgmt-batch==17.3.0
 azure-mgmt-compute==33.0.0
-azure-mgmt-cdn==13.1.1
+azure-mgmt-cdn==12.0.0
 azure-mgmt-containerinstance==10.1.0
 azure-mgmt-core==1.4.0
 azure-mgmt-containerregistry==10.3.0
 azure-containerregistry==1.2.0
-azure-mgmt-containerservice==32.1.0
+azure-mgmt-containerservice~=31.0.0
 azure-mgmt-datafactory==9.0.0
-azure-mgmt-dns==8.1.0
-azure-mgmt-marketplaceordering==1.2.0b2
-azure-mgmt-monitor==6.0.2
-azure-mgmt-managedservices==7.0.0b2
-azure-mgmt-managementgroups==1.1.0b2
+azure-mgmt-dns~=8.0.0
+azure-mgmt-marketplaceordering==1.1.0
+azure-mgmt-monitor~=5.0.0
+azure-mgmt-managedservices~=1.0
+azure-mgmt-managementgroups~=1.0.0
 azure-mgmt-network==28.0.0
 azure-mgmt-nspkg==3.0.2
-azure-mgmt-privatedns==1.1.0
+azure-mgmt-privatedns~=1.0.0
 azure-mgmt-redis==14.4.0
-azure-mgmt-resource==23.2.0
+azure-mgmt-resource==23.1.1
 azure-mgmt-rdbms==10.2.0b17
 azure-mgmt-search==9.2.0b2
 azure-mgmt-servicebus==8.2.1
-azure-mgmt-sql==4.0.0b19
-azure-mgmt-storage==21.2.1
-azure-mgmt-trafficmanager==1.1.0
-azure-mgmt-web==7.3.1
+azure-mgmt-sql==4.0.0b17
+azure-mgmt-storage==21.2.0
+azure-mgmt-trafficmanager~=1.0.0
+azure-mgmt-web==7.2.0
 azure-nspkg==3.0.2
 azure-storage-blob==12.23.0b1
 azure-core==1.31.0
 azure-keyvault==4.2.0
-azure-mgmt-keyvault==10.3.1
-azure-mgmt-cosmosdb==10.0.0b3
-azure-mgmt-hdinsight==9.1.0b1
-azure-mgmt-devtestlabs==10.0.0b2
-azure-mgmt-loganalytics==13.0.0b7
+azure-mgmt-keyvault==10.3.0
+azure-mgmt-cosmosdb==9.5.1
+azure-mgmt-hdinsight==9.0.0b3
+azure-mgmt-devtestlabs~=4.0
+azure-mgmt-loganalytics==13.0.0b4
 azure-mgmt-automation==1.1.0b4
 azure-mgmt-iothub==3.0.0
 azure-iot-hub==2.6.1;platform_machine=="x86_64"
 azure-mgmt-recoveryservices==3.0.0
 azure-mgmt-recoveryservicesbackup==9.1.0
 azure-mgmt-notificationhubs==8.1.0b1
-azure-mgmt-eventhub==11.1.0
+azure-mgmt-eventhub~=10.1.0

@Klaas-
Copy link
Contributor Author

Klaas- commented Dec 7, 2024

some of those requirements are not even in latest version of azure cli :) https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/requirements.py3.Linux.txt

Diff to make it work with the latest azure-cli version:

diff --git a/requirements.txt b/requirements.txt
index fd6953f..0e23c71 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,50 +2,50 @@ packaging
 requests[security]
 xmltodict
 msgraph-sdk==1.6.0
-azure-cli-core==2.64.0
+azure-cli-core==2.67.0
 azure-common==1.1.28
 azure-identity==1.19.0
 azure-mgmt-authorization==4.0.0
-azure-mgmt-apimanagement==4.0.1
+azure-mgmt-apimanagement==4.0.0
 azure-mgmt-batch==17.3.0
 azure-mgmt-compute==33.0.0
-azure-mgmt-cdn==13.1.1
-azure-mgmt-containerinstance==10.1.0
+azure-mgmt-cdn==12.0.0
+azure-mgmt-containerinstance==10.2.0b1
 azure-mgmt-core==1.4.0
 azure-mgmt-containerregistry==10.3.0
 azure-containerregistry==1.2.0
-azure-mgmt-containerservice==32.1.0
+azure-mgmt-containerservice~=33.0.0
 azure-mgmt-datafactory==9.0.0
-azure-mgmt-dns==8.1.0
-azure-mgmt-marketplaceordering==1.2.0b2
-azure-mgmt-monitor==6.0.2
+azure-mgmt-dns~=8.0.0
+azure-mgmt-marketplaceordering==1.1.0
+azure-mgmt-monitor~=5.0.0
 azure-mgmt-managedservices==7.0.0b2
-azure-mgmt-managementgroups==1.1.0b2
+azure-mgmt-managementgroups~=1.0.0
 azure-mgmt-network==28.0.0
 azure-mgmt-nspkg==3.0.2
-azure-mgmt-privatedns==1.1.0
+azure-mgmt-privatedns~=1.0.0
 azure-mgmt-redis==14.4.0
-azure-mgmt-resource==23.2.0
+azure-mgmt-resource==23.1.1
 azure-mgmt-rdbms==10.2.0b17
 azure-mgmt-search==9.2.0b2
 azure-mgmt-servicebus==8.2.1
-azure-mgmt-sql==4.0.0b19
-azure-mgmt-storage==21.2.1
-azure-mgmt-trafficmanager==1.1.0
-azure-mgmt-web==7.3.1
+azure-mgmt-sql==4.0.0b20
+azure-mgmt-storage==21.2.0
+azure-mgmt-trafficmanager~=1.0.0
+azure-mgmt-web==7.2.0
 azure-nspkg==3.0.2
 azure-storage-blob==12.23.0b1
 azure-core==1.31.0
 azure-keyvault==4.2.0
-azure-mgmt-keyvault==10.3.1
-azure-mgmt-cosmosdb==10.0.0b3
-azure-mgmt-hdinsight==9.1.0b1
-azure-mgmt-devtestlabs==10.0.0b2
-azure-mgmt-loganalytics==13.0.0b7
+azure-mgmt-keyvault==10.3.0
+azure-mgmt-cosmosdb==9.6.0
+azure-mgmt-hdinsight==9.0.0b3
+azure-mgmt-devtestlabs~=4.0
+azure-mgmt-loganalytics==13.0.0b4
 azure-mgmt-automation==1.1.0b4
 azure-mgmt-iothub==3.0.0
 azure-iot-hub==2.6.1;platform_machine=="x86_64"
 azure-mgmt-recoveryservices==3.0.0
 azure-mgmt-recoveryservicesbackup==9.1.0
 azure-mgmt-notificationhubs==8.1.0b1
-azure-mgmt-eventhub==11.1.0
+azure-mgmt-eventhub~=10.1.0

@Fred-sun Fred-sun added the work in In trying to solve, or in working with contributors label Dec 9, 2024
@Fred-sun
Copy link
Collaborator

Fred-sun commented Dec 9, 2024

@Klaas- Welcome to submit the problems encountered, I will test the system in your report, in addition, I tested on the virtual machine of ubuntu 22.04 without any errors, thank you!

 azureuser@fredVM:/usr/local/lib/python3.10$ pip3 list |grep 'azure-cli'
azure-cli                                  2.67.0
azure-cli-core                             2.64.0
azure-cli-telemetry                        1.1.0
azureuser@fredVM:/usr/local/lib/python3.10$ ansible-galaxy collection list

# /home/azureuser/.ansible/collections/ansible_collections
Collection                               Version
---------------------------------------- -------
azure.azcollection                       3.1.0

@Klaas-
Copy link
Contributor Author

Klaas- commented Dec 9, 2024

Hi @Fred-sun
I think you just installed azure collection after you installed azure-cli?

Just looking at those two lines:

https://github.com/Azure/azure-cli/blob/ccc6fd5065c4aaa4e63383dce9ca64b7c50380ee/src/azure-cli/requirements.py3.Linux.txt#L7
(not sure why this is not showing the preview, but the line says:
azure-cli-core==2.67.0

and

azure-cli-core==2.64.0

they can't be satisfied at the same time, I am unsure why pip allows you to downgrade azure-cli-core from 2.67 to 2.64 though, that should be blocked by azure-cli requirement?

You can easily see the depenedency problems if you use a recent pip and run
python -m pip install -r requirements.txt azure-cli==2.64.0
or
python -m pip install -r requirements.txt azure-cli==2.67.0
if you want the newest azure-cli

or you can simply add azure-cli==2.64.0 to your requirements file and see it fail

@Fred-sun
Copy link
Collaborator

@Klaas- This change is not recommended because many modules depend on deleted packages.

Can you try it first by following the steps below?

1. Install azure-cli. If you need to log in, log in first (az login --tenant *****)

2. Install the ansible, azure. azcollection, and requirements.txt files.

@Fred-sun Fred-sun added the question Further information is requested label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants