Describe the bug
The instructions for installation via zypper fail on SLES 12 SP3 due to a dependency on python2-virtualenv
To Reproduce
Follow the instructions here: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-zypper?view=azure-cli-latest when running on SLES 12 SP3
> sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
> sudo zypper addrepo --name 'Azure CLI' --check https://packages.microsoft.com/yumrepos/azure-cli azure-cli
Adding repository 'Azure CLI' ....................................................................................................[done]
Repository 'Azure CLI' successfully added
URI : https://packages.microsoft.com/yumrepos/azure-cli
Enabled : Yes
GPG Check : Yes
Autorefresh : No
Priority : 99 (default priority)
Repository priorities are without effect. All enabled repositories share the same priority.
> sudo zypper install --from azure-cli -y azure-cli
Refreshing service 'SMT-http_smt-azure_susecloud_net'.
Refreshing service 'cloud_update'.
Building repository 'Azure CLI' cache ............................................................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: nothing provides python2-virtualenv needed by azure-cli-2.0.66-3.el7.x86_64
Solution 1: do not install azure-cli-2.0.66-3.el7.x86_64
Solution 2: break azure-cli-2.0.66-3.el7.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/c] (c): c
Expected behavior
Installation of the azure-cli 2.0.66
Environment summary
bash on SLES 12 SP3; package manager: zypper
Additional context
Add any other context about the problem here.
I got the same error on SLES 12 PL 4.
host:~ # zypper install --from azure-cli -y azure-cli
Refreshing service 'SMT-http_smt-azure_susecloud_net'.
Refreshing service 'cloud_update'.
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: nothing provides python2-virtualenv needed by azure-cli-2.0.66-3.el7.x86_64
Solution 1: do not install azure-cli-2.0.66-3.el7.x86_64
Solution 2: break azure-cli-2.0.66-3.el7.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/c] (c): c
Howdy @achandmsft, I'm going to need your help prioritizing this issue. :)
Are there any updates on this?
Are there any updates on this?
No update yet?
The CLI is also compatible with Python 2.7.x
https://docs.microsoft.com/en-US/cli/azure/install-azure-cli-linux?view=azure-cli-latest
@achandmsft please weigh in :)
Some commands like "az iot hub monitor-events" result in the error "Python version 3.5 or higher required for this functionality."
The CLI will only install for me if I have 2.7, but I cannot seem to change the version used by using aliases, etc. I have spun up fresh images with different flavors of Unix under AWS and always get the same issue. I am not interested in a manual install since that cannot be scripted and requires a UI.
az --version will always point to "Python location '/usr/bin/python2'" and "Python (Linux) 2.7.14 (default, Nov 30 2017, 11:33:17) [GCC]"
Is there any CLI config file or something which can be done to point it to 3.5+ after install?
Still the same error with azure-cli-2.0.71-1.el7.x86_64. Would be nice to have a solution anytime in 2019.
Problem: nothing provides python-virtualenv needed by azure-cli-2.0.71-1.el7.x86_64
Solution 1: do not install azure-cli-2.0.71-1.el7.x86_64
Solution 2: break azure-cli-2.0.71-1.el7.x86_64 by ignoring some of its dependencies
Are there any updates?
Same error on version 72:
# sudo zypper install --from azure-cli -y azure-cli
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: nothing provides python-virtualenv needed by azure-cli-2.0.72-1.el7.x86_64
Solution 1: do not install azure-cli-2.0.72-1.el7.x86_64
Solution 2: break azure-cli-2.0.72-1.el7.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/c] (c): c
Note that dependencies got changed from python2-virtualenv
to python-virtualenv
.
Same on SLES 12 SP 4, Python 3.4
Problem: nothing provides python-virtualenv needed by azure-cli-2.0.72-1.el7.x86_64
We also have the same issue, I hope someone from Azure will tackle this soon:
# cat /etc/os-release
NAME="SLES"
VERSION="12-SP4"
VERSION_ID="12.4"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp4"
# zypper install --from azure-cli -y azure-cli
Building repository 'Azure CLI' cache .................................................................................................................................................................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: nothing provides python-virtualenv needed by azure-cli-2.0.72-1.el7.x86_64
Solution 1: do not install azure-cli-2.0.72-1.el7.x86_64
Solution 2: break azure-cli-2.0.72-1.el7.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/c] (c): c
Any updates on this?
VM created on azure today using Suse 12 SP4 same dependecy error.
suse-syslog:/scripts # cat /etc/os-release
NAME="SLES"
VERSION="12-SP4"
VERSION_ID="12.4"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp4
Problem: nothing provides python-virtualenv needed by azure-cli-2.0.72-1.el7.x86_64
Solution 1: do not install azure-cli-2.0.72-1.el7.x86_64
Solution 2: break azure-cli-2.0.72-1.el7.x86_64 by ignoring some of its dependencies
Thanks
Please remove the -y option when install: sudo zypper install --from azure-cli azure-cli
, then input 2
to continue install.
Since Python 3.3, a subset of python-virtualenv has been integrated into the standard library under the venv module(quotes from here). I don't think the lack of python-virtualenv will break things, at least for most of the feature. It should work. Let me know if you still have any issue.
susenode03:~ # zypper install --from azure-cli azure-cli
Refreshing service 'SUSE_Linux_Enterprise_High_Availability_Extension_12_SP3_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Server_12_SP3_x86_64'.
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: nothing provides python-virtualenv needed by azure-cli-2.0.74-1.el7.x86_64
Solution 1: do not install azure-cli-2.0.74-1.el7.x86_64
Solution 2: break azure-cli-2.0.74-1.el7.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/c] (c):
@amitsuneja can you type 2 for the prompt and continue the install?
@fengzhou-msft
Ignoring the dependency I could install and run it successfully.
matheus@suse-syslog:~> az --version
azure-cli 2.0.74
command-modules-nspkg 2.0.3
core 2.0.74
nspkg 3.0.4
telemetry 1.0.3
Python location '/usr/bin/python'
Extensions directory '/home/matheus/.azure/cliextensions'
Python (Linux) 2.7.13 (default, Jan 11 2017, 10:56:06) [GCC]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Thank you
If python2-virtualenv is not required - would it be possible to remove the dependency to get error-free experience?
When installed manually you might type in 2 but this is extremely unfriendly for any automated install..
@krojzl We're working on the improvement of packaging #7387 and will consider the possibility of removing python-virtualenv.
Dependency of python-virtualenv
is removed in azure-cli 2.0.77. The RPM package now only depends on python3
package.
Since SLES 12 doesn't have sound support for Python 3.6 yet, please sudo bash
the following script to build Python 3.6 from source and install azure-cli 2.0.77 with no dependency option on SLES 12:
#!/usr/bin/env bash
sudo zypper install -y gcc gcc-c++ make ncurses patch wget tar zlib-devel zlib
mkdir -p /tmp/python_src_3_6_9
cd /tmp/python_src_3_6_9
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
tar -xvf Python-3.6.9.tar.xz
cd Python-3.6.9
./configure --with-ssl
make
sudo make install
cd ..
wget https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.0.77-1.el7.x86_64.rpm
sudo rpm -Uvh --nodeps azure-cli-2.0.77-1.el7.x86_64.rpm
cd ~
@yonzhan , this ended up in my Inbox for Azure CLI, so I have created work item https://dev.azure.com/mseng/TechnicalContent/_workitems/edit/1683408 and will follow up with you in our text technical check-in.
@dbradish-microsoft I've updated the instruction for installing version >= 2.0.77: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-zypper?view=azure-cli-latest#install-on-sles-12-or-other-systems-without-python-36
The instruction in your work item is for versions <= 2.0.76 with python 2 in our package.
Most helpful comment
Please remove the -y option when install:
sudo zypper install --from azure-cli azure-cli
, then input2
to continue install.Since Python 3.3, a subset of python-virtualenv has been integrated into the standard library under the venv module(quotes from here). I don't think the lack of python-virtualenv will break things, at least for most of the feature. It should work. Let me know if you still have any issue.