-
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
With Azure CLI 2.0.70 az cli commands are not working when run from within Python (3.6.8) virtual env on CentOS 7.5 #10128
Comments
@zikalino, could you please take a look? |
I am getting this exact issue:
Is there any update as to the cause? |
Hello, I am getting exactle the same error on Fedora 30 and 31. I can install the az package, but then any command ends with the same issue.
|
@fengzhou-msft please take a look. |
Hitting the same issue. |
RPM installed azure cli previous to 2.0.76 is using Python 2 with a bunch of site-packages, if |
Describe the bug
With Azure CLI 2.0.70 az cli commands are not working when run from within Python (3.6.8) virtual env on CentOS 7.5.
Any az cli command is throwing error when run from within Python (3.6.8) virtual env on CentOS 7.5
To Reproduce
Install az cli based on documented steps at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-yum?view=azure-cli-latest
Install Python 3.6.8 on CentOS based 7.5
create python virtual environment
cd ~
python3.6 -m venv env
Activate the Python Virtual Environment :- source ~/env/bin/activate
az login command throws following error from within python virtual environment
Traceback (most recent call last):
File "/usr/lib64/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib64/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/usr/lib64/az/lib/python2.7/site-packages/azure/init.py", line 1, in
import('pkg_resources').declare_namespace(name)
File "/usr/lib64/az/lib/python2.7/site-packages/pkg_resources/init.py", line 24, in
import re
File "/usr/lib64/python3.6/re.py", line 142, in
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Expected behavior
az cli commands should work without giving error.
Environment summary
Install Method
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[azure-cli]\nname=Azure CLI\nbaseurl=https://packages.microsoft.com/yumrepos/azure-cli\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/azure-cli.repo'
sudo yum install azure-cli
OS :- CentOS based 7.5 Image on Azure VM
Python 3.6.8 installed using
sudo yum install epel-release
sudo yum install python36 python36-devel python36-setuptools
python36 --version
python virtual environment created using
cd ~
python3.6 -m venv env
source env/bin/activate
python --version
Additional context
if the az cli earlier version 2.0.69 is installed the same works fine
wget https://packages.microsoft.com/yumrepos/azure-cli/azure-cli-2.0.69-1.el7.x86_64.rpm
sudo yum install azure-cli-2.0.69-1.el7.x86_64.rpm
az cli (2.0.69) commands works normally with same OS environment in a python 3.6.8 virtual environment
The text was updated successfully, but these errors were encountered: