Azure-cli: `pip install azure-cli==0.1.1b2` broken! (no module named _logging)

Created on 4 Feb 2017  路  10Comments  路  Source: Azure/azure-cli

I have a Docker container where I pin to a specific version of the CLI:

ENV AZURE_CLI_VERSION 0.1.1b2
...
RUN pip install azure-cli==${AZURE_CLI_VERSION}

Obviously the first thing we do is run az login ......

Today someone reported it didn't work. Turns out, works on my machine because the layers were cached, presumably from before 0.1.1b3 was released. So, I cleared all my cached docker layers and images and executed it again... and sure enough mine doesn't work now either.

$ az login

root@7b04240ef178:/gopath/src/github.com/Azure/acs-engine# az login
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/azure/cli/__main__.py", line 9, in <module>
    import azure.cli.main
  File "/usr/local/lib/python2.7/dist-packages/azure/cli/main.py", line 10, in <module>
    import azure.cli.core._logging as _logging
ImportError: No module named _logging

0.1.1b3 works, but I really don't want this to break in another 2 weeks

Most helpful comment

They can be found here https://github.com/Azure/azure-cli/tree/master/packaged_releases/pip_requirements]

cc: @yugangw-msft, @johanste

All 10 comments

pip install azure-cli==0.1.1b2 installs an older version of azure-cli but the latest versions of all other components (azure-cli-core, azure-cli-vm, azure-cli-network, etc.).

Versions of each module should be specified.
Here are a couple of ways to do it:

pip install azure-cli==0.1.1b2 azure-cli-acr==0.1.1b1 azure-cli-acs==0.1.1b1 azure-cli-appservice==0.1.1b1 azure-cli-cloud==0.1.1b1 azure-cli-component==0.1.0rc1 azure-cli-configure==0.1.1b2 azure-cli-container==0.1.1b1 azure-cli-context==0.1.1b1 azure-cli-core==0.1.1b2 azure-cli-feedback==0.1.1b1 azure-cli-network==0.1.1b1 azure-cli-nspkg==0.1.1 azure-cli-profile==0.1.1b1 azure-cli-resource==0.1.1b1 azure-cli-role==0.1.1b1 azure-cli-storage==0.1.1b1 azure-cli-vm==0.1.1b1
$ echo "azure-cli==0.1.1b2
azure-cli-acr==0.1.1b1
azure-cli-acs==0.1.1b1
azure-cli-appservice==0.1.1b1
azure-cli-cloud==0.1.1b1
azure-cli-component==0.1.0rc1
azure-cli-configure==0.1.1b2
azure-cli-container==0.1.1b1
azure-cli-context==0.1.1b1
azure-cli-core==0.1.1b2
azure-cli-feedback==0.1.1b1
azure-cli-network==0.1.1b1
azure-cli-nspkg==0.1.1
azure-cli-profile==0.1.1b1
azure-cli-resource==0.1.1b1
azure-cli-role==0.1.1b1
azure-cli-storage==0.1.1b1
azure-cli-vm==0.1.1b1" > constraints.txt

$ pip install azure-cli --constraint constraints.txt

Thanks!

  1. How do I know the right mix of versions? In the example you show, not everything is at b2. I guess I just take note at a point in time where it works?

  2. Is it not possible to make the 0.1.1b2 package explicitly depend on 0.1.1b2 of it's command modules? Or is that not desired?

  1. You can take note of them whenever you wish. e.g. $ pip freeze | grep azure-cli gives you the full list so you can save to a constraints.txt file and use later. Alternatively, periodically we release packaged releases which bundle a known set of versions together. In the release history, you'll see a list of all the modules and their versions (https://github.com/Azure/azure-cli/blob/master/packaged_releases/HISTORY.md). In this case, the versions you were after mapped to the 0.1.7 release.

  2. It's not desired as it would mean that any time any command module was updated, we'd also have to create a new release of azure-cli to change the explicit version dependency.

Thanks again @derekbekoe !

I know I closed this, but the current circumstances make it very non-trivial to pin to a version of the CLI in something like, a docker container.

Related to this comment.
https://github.com/Azure/azure-cli/issues/2190#issuecomment-281471482

@colemickens if we provide a 'pip freeze' that has a list of all the dependencies that were released when the CLI was updated, would that help?
So then you can run pip install -r release_feb.txt would that help?

This release_feb.txt would be available publicly on the GitHub repo so you can curl/wget it as needed.

cc: @yugangw-msft, @johanste

That'd be great!

They can be found here https://github.com/Azure/azure-cli/tree/master/packaged_releases/pip_requirements]

cc: @yugangw-msft, @johanste

Hi. What happened to this? What's the equivalent now?

See https://github.com/Azure/azure-cli/issues/5223#issuecomment-356063391 and also the last comment from me for the correct image name.

Was this page helpful?
0 / 5 - 0 ratings