-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error on az connectedk8s connect: cannot import name '_psutil_linux' from partially initialized module 'psutil' #18222
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @akashkeshari. Issue DetailsDescribe the bugWhen running Command Name Errors:
To Reproduce:Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
Expected BehaviorThe command works. Environment Summary
Additional Context
|
route to service team |
Linux stkirk-fedora 5.12.6-300.fc34.x86_64 #1 SMP Sat May 22 20:42:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Extensions: I have also experienced the exact same behavior as noted above. This issue does not seem to be present on debian/ubuntu type installs of the AZCLI. I have tried this with Fedora 33, Fedora 34 and RHEL 8 (all RPM based distributions) and the process fails each time: [stkirk@stkirk-fedora aro4]$ az connectedk8s connect --name $arcName --resource-group $aroRG --location $arcLocation |
I have found a workaround: In
It seems that the RPM packages uses Python 3.6 but the |
Confirmed this works. I had a feeling that this was the issue given the higher rev of python. I tried using "alternatives" to get Fedora to set the default python to 3.6 however that didn't seem to work so was at a loss. cc: @yonzhan |
@derkoe, you analysis helps a lot. If you extract the rpm package
This means This is because Azure CLI is built using
Only python 3.6 is available in I haven't tested Fedora 34. Could you verify if Python 3.6 exists on any Fedora 34 installation? If so we can fix it by using Python 3.6 for now:
|
Fedora 34 defaults to Python 3.9 but Python 3.6 is also available (as /usr/bin/python3.6). |
If you have a Docker (or another container runtime) you can do:
|
@derkoe, thanks for the info. We will join the the Kick-off event recently. We will look at it after we return. |
@jiasli Any update on this issue? |
@derkoe, I am able to repro this issue on fedora:34 following Install the Azure CLI on Linux. However, fedora:34 doesn't seem to have python 3.6 pre-installed:
We got similar issues with the WorkaroundsIn this case for Reinstall
|
Thx @jiasli this workaround also works. Anyway, I think this should be fixed in the RPM package. |
@derkoe, exactly. However, I don't think this will be an easy fix, as we need to release different RPM packages for different versions of Python installed on the system, due to different dependencies on
Then we need to write an installation script to install corresponding RPM packages according to the output of Another solution: Currently for Windows and Ubuntu, we bundle an embedded Python within the MSI and deb installer, perhaps we can adopt the same approach for RPM. |
In the old version you could have also fixed that in the shell script by replacing "python" with "python3.6". I guess in the current version you could patch the python version here https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/az#L1 ("python" -> "python3.6") |
Per my observation, Fedora:34 doesn't seem to have python 3.6 pre-installed:
|
When you install Azure CLI RPM the 3.6 is installed as well (it is a dependency). |
Aha, I forgot about that. Thanks @derkoe. I got confused by Let me create a PR to fix
However, Lines 1 to 19 in abc5125
So it will be compatible with the python on your |
Describe the bug
When running
az connectedk8s connect
I get an error on Linux (Fedora 34).Command Name
az connectedk8s connect
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az extension add --name connectedk8s
az connectedk8s connect
Expected Behavior
The command works.
Environment Summary
Additional Context
The text was updated successfully, but these errors were encountered: