azure-cli: Clean install of CLI on OpenSUSE 15 gives error: NotImplementedError: APIVersion 2019-06-01 is not available
This is autogenerated. Please review and update as needed.
Describe the bug
Created brand-new OpenSUSE 15.1 VM, Installed CLI as per instructions here:
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-zypper?view=azure-cli-latest
az login
gives error: Error loading command module ‘aro’: No module named ‘azure.mgmt.redhatopenshift’ details below:
Command Name
az login
Errors:
APIVersion 2019-06-01 is not available
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 215, in invoke
cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 631, in execute
raise ex
cli/core/commands/__init__.py, ln 695, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 688, in _run_job
six.reraise(*sys.exc_info())
...
azure/cli/core/_profile.py, ln 844, in find_through_interactive_flow
result = self._find_using_common_tenant(token_entry[_ACCESS_TOKEN], resource)
azure/cli/core/_profile.py, ln 877, in _find_using_common_tenant
tenants = client.tenants.list()
mgmt/resource/subscriptions/subscription_client.py, ln 122, in tenants
raise NotImplementedError("APIVersion {} is not available".format(api_version))
NotImplementedError: APIVersion 2019-06-01 is not available
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- create new OpenSUSE Leap 15.1 VM
- install CLI as per https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-zypper?view=azure-cli-latest
az login
Expected Behavior
CLI should login to my Azure account/subscription
Environment Summary
Linux-4.12.14-lp151.28.7-default-x86_64-with-glibc2.3.4
Python 3.6.5
Installer: RPM
azure-cli 2.4.0
Additional Context
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 34 (8 by maintainers)
I can repro this issue on openSUSE Leap 15.1. We actually saw this issue before in #12783, #12878, #12779 and mistook it for some
pipinstallation problem.This is the pre-installed Azure CLI on openSUSE Leap 15.1:
We have two options here:
1. Contact openSUSE to remove the pre-installed Azure CLI
Since openSUSE Leap 15.1 is not maintained by Microsoft, we need to contact openSUSE to remove the pre-installed Azure CLI to avoid all kinds of problems. Moreover, it can probably cause other problems once we move to PEP 420 (#13293).
2. Ship Azure CLI with its own Python
After installing Azure CLI with zypper, we can run
We can see Azure CLI is using the system
/usr/bin/python3on openSUSE, it may conflicts with the pre-installed packages. We can ship Azure CLI with its own Python like how we do on Ubuntu with a deb package.It seems OpenSUSE 15.1 VM comes with a very old version of azure cli (2.0.45). It has a bunch of old
azure-cli-*module packages and old dependencies installed in the system python site-packages directory(/usr/lib/python3.6/site-packages). With newer versions of azure-cli, all the modules are consolidated into oneazure-clipackage and all dependecies are installed under/usr/lib64/az/lib/python3.6/site-packagesto not share the dependencies on purpose. The old dependencies was loaded and caused issues.If you haven’t installed other python packages, the easiest way to clean up these old azure-cli packages and dependencies is to
sudo zypper remove python3andsudo rm -rf /usr/lib/python3.6/site-packages. Then you can runsudo zypper install --from azure-cli azure-clito install the latestazure-cliand its dependencies includingpython3.