-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
On Python 2, upgrading from 0.1.0b10 to 0.1.0b11 may cause 'KeyError: Azure' error #1540
Comments
I believe I'm also experiencing this now after the upgrade. I get this when I type az: Going through the install again also does not fix the problem. |
If you have python3 and pip3 installed you might need to do this before it works: |
@dtzar Running the following commands should resolve the issue.
|
@nzthiago pip3 wasn't installed, but I installed it and gave your command a try (with and without --upgrade) and the same using just pip and I get: I also tried the recommend per release notes: @derekbekoe touch does |
@dtzar The error "Could not find a version that satisfies the requirement azure-cli" from pip usually means an old version of pip is installed. Run In #1540 (comment), the commands I provided were based off #1540 (comment) but it looks like those directories were deleted at some point so that's why that doesn't work. Finally, the curl script is a good install option. |
I had the latest version as you mentioned of pip. Why are the default installation directories not what is recommended? I installed via curl again to the directory you mentioned and still to no avail. I'm going to just keep using the docker image. If you want to live troubleshoot, feel free to reach out to me inside MSFT. |
Will do. |
Closed as the issue is marked as FAQ and it's documented in our install troubleshooting doc - https://github.com/Azure/azure-cli/blob/master/doc/install_troubleshooting.md#upgrade-from-010b10-causes-keyerror-azure-error. |
thanks to @brusMX I got this working via these commands: I am using Windows 10 bash, so perhaps the issue is unique to this when doing a curl | bash install method. |
Also, just to point out that the error @dtzar is running into is by installing the Az Cli in Windows 10 with Ubuntu bash through this command:
That command is actually setting the contents of the |
@brusMX This is intended. In your case, the root of this virtualenv is |
Also, previously the default location of this virtualenv was |
I supposed so @derekbekoe So if anybody else runs into this issue, they could realize that their virtualenv could be different. |
On 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:
<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 #1406 occurs again.
Python 3 works because of implicit namespace package support.
The text was updated successfully, but these errors were encountered: