az feedbackauto-generates most of the information requested below, as of CLI version 2.0.74
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
[root@6e5b7a6907ed /]# yum install azure-cli
Failed to set locale, defaulting to C
CentOS-8 - AppStream 2.4 MB/s | 6.0 MB 00:02
CentOS-8 - Base 1.2 MB/s | 7.9 MB 00:06
CentOS-8 - Extras 639 B/s | 2.1 kB 00:03
Azure CLI 4.3 MB/s | 11 MB 00:02
Last metadata expiration check: 0:00:01 ago on Mon Oct 14 17:14:55 2019.
Error:
Problem: cannot install the best candidate for the job
- nothing provides python needed by azure-cli-2.0.74-1.el7.x86_64
- nothing provides python-virtualenv needed by azure-cli-2.0.74-1.el7.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@6e5b7a6907ed /]# yum whatprovides python
Failed to set locale, defaulting to C
Last metadata expiration check: 0:01:04 ago on Mon Oct 14 17:14:55 2019.
Error: No Matches found
[root@6e5b7a6907ed /]# yum whatprovides python3
Failed to set locale, defaulting to C
Last metadata expiration check: 0:01:18 ago on Mon Oct 14 17:14:55 2019.
python36-3.6.8-2.module_el8.0.0+33+0a10c0e1.x86_64 : Interpreter of the Python programming language
Repo : AppStream
Matched from:
Provide : python3 = 3.6.8-2.module_el8.0.0+33+0a10c0e1
Expected behavior
azure-cli will be successfully installed in a CentOS 8x container.
Environment summary
Followed the instructions on https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest and installed azure-cli with yum.
Red Hat Enterprise Linux 8 systems are not officially supported yet. You can follow the workaround for now:
$ sudo yum install python2
$ sudo yum install yum-utils
$ sudo yumdownloader azure-cli
$ sudo rpm -ivh --nodeps azure-cli-2.0.74-1.el7.x86_64.rpm
Then edit the second line of /usr/bin/az (result of which az) to specify using python2:
PYTHONPATH=/usr/lib64/az/lib/python2.7/site-packages python2 -sm azure.cli "$@"
The exact same problem has appeared on SLES12. It used to work. I can not install this package on new systems, and I cannot update the package on servers where it is already installed.
Expanding the ticket subject to include the specific dependency python-virtualenv may allow this ticket to own this specific dependency problem across all affected platforms.
Was this issue resolved?
@yonzhan There's no proposed solution, no code change/PR and there's me confirming that this really is an issue. This issue is not resolved at all - it's a blocking problem. I can no longer use azure cli for backups because I cannot install it/update it anymore. It's been in use for a couple of years. It's a critical issue for us. I can find ways around it, but I hope we can find a solution - SLES is still indicated as supported in the docs :)
I too got somewhat same error, and python 2.x should not be solution for it since it is going out of service in few weeks.
[/work/demo]$ sudo yum install azure-cli
CentOS-8 - AppStream 1.8 kB/s | 4.3 kB 00:02
CentOS-8 - Base 1.7 kB/s | 3.9 kB 00:02
CentOS-8 - Extras 701 B/s | 1.5 kB 00:02
Azure CLI 2.4 kB/s | 2.9 kB 00:01
Extra Packages for Enterprise Linux 8 - x86_64 14 kB/s | 19 kB 00:01
google-chrome 1.1 kB/s | 1.3 kB 00:01
Error:
Problem: cannot install the best candidate for the job
Having same problem. Installing python2 is not solution for us.
It's time to build an el8 package with Python 3.
Also just ran into the same issue. We're already testing with rhel 8 and are transitioning to python3 across the board. Sticking with python 2 isn't going to be an option for us in the future.
Same here. When will Centos 8 be supported?
Info for people waiting for RHEL/Centos 8 support based on my digging:
Update of .spec file was 6 months ago (#9394). PR which actually builds el8 package (#11204) was just merged yesterday. So there is hope that .rpm will be available in repo _soon_.
@pkoziol change of plan. We have this PR #11275 to build el7 package with Python 3. It would support Centos 8/RHEL 8 already. I'm going to revert el8 #11325
With Centos 7.7 and RHEL 7.7 supporting Python 3. We can finally make the call to use Python 3 for rpm package.
Please upgrade to 2.0.77.
yum install -y python3-devel gcc
pip3 install azure-cli
worked for me in a docker image