On Python 2, upgrading from 0.1.0b10 to 0.1.0b11 may cause 'KeyError: Azure' error
See original GitHub issueOn Python 2, it’s recommended to upgrade with the --ignore-installed
flag:
pip install --upgrade --ignore-installed azure-cli
.
If the above isn’t followed, KeyError may appear as pip fails to install 2 required files. Add these manually with:
touch <path_to_site_packages>/azure/cli/__init__.py
touch <path_to_site_packages>/azure/cli/command_modules/__init__.py
<path_to_site_packages> is the path to the environment the CLI was installed into. For example /usr/local/lib/python2.7/site-packages.
This is a one-time change.
Fresh installs are not affected.
More info:
Upgrading from the previous version of the CLI to this version breaks on Python 2. It breaks because pip attempts to uninstall the old version first so https://github.com/Azure/azure-cli/issues/1406 occurs again. Python 3 works because of implicit namespace package support.
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Cannot upgrade azure cli to the latest version - Stack Overflow
0b10 Found link https://files.pythonhosted.org/packages/a9/62/1ec7e1685fa805322cad62a8a281008e21436bf97010f291b962840255fc/azure-cli-0.1.0b11.
Read more >azure-cli-profile 2.1.5 - PyPI
BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. 2.0.27. login: use browser for...
Read more >marshmallow - Read the Docs
marshmallow is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.
Read more >Upgrading Python on Azure App Service
The obvious solution here is to simply upgrade Python so that everyone has the latest improvements, bug and security fixes. But unfortunately, ...
Read more >Micro Focus Desktop Containers 22.4 Documentation
Users who run Turbo applications on their local Windows Desktop may access the local ... [ip-add] *.forbes.com 127.0.0.1 tiles.r53-2.services.mozilla.com ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thanks to @brusmx I got this working via these commands: touch /usr/local/az/lib/python2.7/site-packages/azure/cli/command_modules/init.py touch /usr/local/az/lib/python2.7/site-packages/azure/cli/init.py
I am using Windows 10 bash, so perhaps the issue is unique to this when doing a curl | bash install method.
I supposed so @derekbekoe What I intended to communicate is that it was unclear to determine the root of the virtualenv. Especially from what you just communicated, the last version of the code says
DEFAULT_INSTALL_DIR = os.path.expanduser(os.path.join('~', 'lib', 'azure-cli'))
and not really/usr/local/az
So if anybody else runs into this issue, they could realize that their virtualenv could be different.