Azure-cli: has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.

Created on 6 Aug 2018  路  16Comments  路  Source: Azure/azure-cli

Describe the bug
Get this when I run pip install

azure-mgmt-batch 4.1.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-trafficmanager 0.40.0 has requirement msrestazure~=0.4.8, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-servicefabric 0.1.0 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-recoveryservices 0.1.0 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-cognitiveservices 1.0.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-eventhub 1.2.0 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-devtestlabs 2.0.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-datalake-analytics 0.2.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-keyvault 0.40.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-redis 4.1.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-recoveryservicesbackup 0.1.1 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-datalake-store 0.2.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-storage 1.5.0 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-iothubprovisioningservices 0.1.0 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.5.0 which is incompatible.
azure-keyvault 0.3.7 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.
azure-mgmt-cdn 1.0.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.5.0 which is incompatible.

To Reproduce

pip install azure-cli

Expected behavior

No errors

Environment summary

created py2 venv with
py -2 -m virtualenv c:\python27.virtualenv\py2

Additional context

i also have py3 installed

Packaging

Most helpful comment

We're in the process of updating dependencies of CLI SDKs to clear these incompatibilities. In reality, these incompatibilities won't impact CLI function. As Laurent mentioned, the azure-cli is not intended to be used as an SDK. It is an application. If there is part of its function is useful to you, please open issue to suggest extract them into independent module.

All 16 comments

//cc: @lmazuel @troydai. I believe this is an expected temporary glitch which will be fixed very soon

Workaround? It's breaking my py2 modules, which I need to ship soon.

@jongio That should not break anything, pip shows this as a warning but still installs everything. And this is still functionnal. Please describe how it breaks something?
Also, you can force a specific version of msrestazure while installing as a short term workaround

pip install msrestazure~=0.4.32 azure-cli

My module does this:

requirements = [
'Click>=6.0',
'docker>=3.4',
'python-dotenv',
'requests',
'fstrings',
'azure-cli-iot',
'azure-cli-profile',
'azure-cli-extension',
'azure-cli-configure',
'azure-cli-resource',
'azure-cli-cloud'
]

Which causes this when run:

I can work around this by removing all the azure-cli* entries and manually installing the azure-cli

pkg_resources.ContextualVersionConflict: (msrestazure 0.5.0 (c:\users\paymaunh\dev\runtime\python\.virtualenv\env27_2\lib\site-packages), Requirement.parse('msrestazure~=0.4.11'), set(['azure-mgmt-iothubprovisioningservices']))

Thx. I will try that version force as well.

Until CLI uses azure-mgmt-iothubprovisioningservices 0.2.0 which has the fix for this, add into your requirements to force msrestazure~=0.4.32

Confirming that this worked

requirements = [
    'Click>=6.0',
    'docker>=3.4',
    'python-dotenv',
    'requests',
    'fstrings',
    'msrestazure~=0.4.32',
    'azure-cli-iot',
    'azure-cli-profile',
    'azure-cli-extension',
    'azure-cli-configure',
    'azure-cli-resource',
    'azure-cli-cloud'
]

Also,

I got it to work by not running pip install -e ., instead running pip install . and then putting that project's root dir in the PYTHONPATH EnvVar.

I've got the same problem. In addition, I'd also like to install "azure" and "azure-cli" together. This causes a bunch of modules to get uninstalled/replaced. Post install of azure-cli, if I try a pip3 install azure, I get:

  Found existing installation: azure-storage-common 1.1.0
    Uninstalling azure-storage-common-1.1.0:
      Successfully uninstalled azure-storage-common-1.1.0
  Found existing installation: azure-mgmt-batch 4.1.0
    Uninstalling azure-mgmt-batch-4.1.0:
      Successfully uninstalled azure-mgmt-batch-4.1.0
  Found existing installation: azure-mgmt-monitor 0.5.0
    Uninstalling azure-mgmt-monitor-0.5.0:
      Successfully uninstalled azure-mgmt-monitor-0.5.0
  Found existing installation: azure-mgmt-redis 4.1.0
    Uninstalling azure-mgmt-redis-4.1.0:
      Successfully uninstalled azure-mgmt-redis-4.1.0
  Found existing installation: azure-mgmt-iothubprovisioningservices 0.1.0
    Uninstalling azure-mgmt-iothubprovisioningservices-0.1.0:
      Successfully uninstalled azure-mgmt-iothubprovisioningservices-0.1.0
  Found existing installation: azure-mgmt-datamigration 0.1.0
    Uninstalling azure-mgmt-datamigration-0.1.0:
      Successfully uninstalled azure-mgmt-datamigration-0.1.0
  Found existing installation: azure-mgmt-containerservice 4.1.0
    Uninstalling azure-mgmt-containerservice-4.1.0:
      Successfully uninstalled azure-mgmt-containerservice-4.1.0
  Found existing installation: azure-mgmt-datalake-store 0.2.0
    Uninstalling azure-mgmt-datalake-store-0.2.0:
      Successfully uninstalled azure-mgmt-datalake-store-0.2.0
  Found existing installation: azure-mgmt-trafficmanager 0.40.0
    Uninstalling azure-mgmt-trafficmanager-0.40.0:
      Successfully uninstalled azure-mgmt-trafficmanager-0.40.0
  Found existing installation: azure-mgmt-media 1.0.0rc1
    Uninstalling azure-mgmt-media-1.0.0rc1:
      Successfully uninstalled azure-mgmt-media-1.0.0rc1
  Found existing installation: azure-mgmt-eventgrid 0.4.0
    Uninstalling azure-mgmt-eventgrid-0.4.0:
      Successfully uninstalled azure-mgmt-eventgrid-0.4.0
  Found existing installation: azure-mgmt-storage 1.5.0
    Uninstalling azure-mgmt-storage-1.5.0:
      Successfully uninstalled azure-mgmt-storage-1.5.0
  Found existing installation: azure-mgmt-network 2.0.0rc3
    Uninstalling azure-mgmt-network-2.0.0rc3:
      Successfully uninstalled azure-mgmt-network-2.0.0rc3
  Found existing installation: azure-mgmt-servicefabric 0.1.0
    Uninstalling azure-mgmt-servicefabric-0.1.0:
      Successfully uninstalled azure-mgmt-servicefabric-0.1.0
  Found existing installation: azure-mgmt-cdn 1.0.0
    Uninstalling azure-mgmt-cdn-1.0.0:
      Successfully uninstalled azure-mgmt-cdn-1.0.0
  Found existing installation: azure-mgmt-dns 2.0.0rc2
    Uninstalling azure-mgmt-dns-2.0.0rc2:
      Successfully uninstalled azure-mgmt-dns-2.0.0rc2
  Found existing installation: azure-mgmt-eventhub 1.2.0
    Uninstalling azure-mgmt-eventhub-1.2.0:
      Successfully uninstalled azure-mgmt-eventhub-1.2.0
  Found existing installation: azure-mgmt-keyvault 0.40.0
    Uninstalling azure-mgmt-keyvault-0.40.0:
      Successfully uninstalled azure-mgmt-keyvault-0.40.0
  Found existing installation: azure-mgmt-cognitiveservices 1.0.0
    Uninstalling azure-mgmt-cognitiveservices-1.0.0:
      Successfully uninstalled azure-mgmt-cognitiveservices-1.0.0
  Found existing installation: azure-mgmt-recoveryservices 0.1.0
    Uninstalling azure-mgmt-recoveryservices-0.1.0:
      Successfully uninstalled azure-mgmt-recoveryservices-0.1.0
  Found existing installation: azure-mgmt-recoveryservicesbackup 0.1.1
    Uninstalling azure-mgmt-recoveryservicesbackup-0.1.1:
      Successfully uninstalled azure-mgmt-recoveryservicesbackup-0.1.1
  Found existing installation: azure-mgmt-devtestlabs 2.0.0
    Uninstalling azure-mgmt-devtestlabs-2.0.0:
      Successfully uninstalled azure-mgmt-devtestlabs-2.0.0
  Found existing installation: azure-mgmt-datalake-analytics 0.2.0
    Uninstalling azure-mgmt-datalake-analytics-0.2.0:
      Successfully uninstalled azure-mgmt-datalake-analytics-0.2.0
  Found existing installation: azure-mgmt-cosmosdb 0.4.0
    Uninstalling azure-mgmt-cosmosdb-0.4.0:
      Successfully uninstalled azure-mgmt-cosmosdb-0.4.0
  Found existing installation: azure-mgmt-containerregistry 2.0.0
    Uninstalling azure-mgmt-containerregistry-2.0.0:
      Successfully uninstalled azure-mgmt-containerregistry-2.0.0
  Found existing installation: azure-storage-blob 1.1.0
    Uninstalling azure-storage-blob-1.1.0:
      Successfully uninstalled azure-storage-blob-1.1.0
  Found existing installation: azure-keyvault 0.3.7
    Uninstalling azure-keyvault-0.3.7:
      Successfully uninstalled azure-keyvault-0.3.7

Is there any way that I can specify a version of azure and azure-cli so that neither has broken dependencies?

azure and azure-cli are not compatible together, since they don't have the same purpose:

  • azure is designed SDK and will install the latest packages of each service
  • azure-cli is designed CLI/shell experience and SDK is an implementation detail, and having the latest of each SDK is not a requirement as long as each command is able to deliver the features needed.

TL;DR; developping SDK using azure-cli is a bad idea.

However, having CLI and a working SDK environment in the same shell makes total sense. What I would suggest is to use two virtualenvs, and link the az into your default PATH. Or pip install the CLI using --user, so the CLI is in your user site-packages, and use a venv on top of that for each SDK devlopment. Note that this is what CLI installers do: they don't install on your system site-packages, they install a venv. You could install the CLI on Windows with the installer or Ubuntu with the apt repo and get this installation for free.

Final note, azure itself is considered a "quickstart" package, and dev for production should be done by targetting individual package (i.e. azure-mgmt-compute).

We're in the process of updating dependencies of CLI SDKs to clear these incompatibilities. In reality, these incompatibilities won't impact CLI function. As Laurent mentioned, the azure-cli is not intended to be used as an SDK. It is an application. If there is part of its function is useful to you, please open issue to suggest extract them into independent module.

This is still occurring, any plans to address it?

Hi @OddBloke , do you have the list of packages that still complains? I would have expected this to be empty by now :(

azure-mgmt-datalake-analytics 0.2.0 has requirement msrestazure~=0.4.7, but you'll have msrestazure 0.6.0 which is incompatible.
azure-mgmt-recoveryservicesbackup 0.1.1 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.6.0 which is incompatible.
azure-mgmt-recoveryservices 0.1.0 has requirement msrestazure~=0.4.11, but you'll have msrestazure 0.6.0 which is incompatible.

(Very easy to reproduce; just pip install azure-cli in a fresh virtualenv.)

I am facing the same issue. I was trying a lot of things. I realised that the problem is with this one.

I've submitted three PRs against the Azure/azure-sdk-for-python repository that should relieve this issue. It should be noted, that this is a workaround more than a fix. The best resolution would be for the commands involved to be updated to adopt the newest versions of the management libraries, as @yugangw-msft had started to do with #8751. However, we need to be able to adopt new versions of msrestazure sooner than would be feasible given the scope of the changes @yugangw-msft was going to have to make.

Thank you much, @lmazuel!

Was this page helpful?
0 / 5 - 0 ratings