Skip to content
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

Python versions above 3.8 should not be reported as OK #26590

Closed
rakotomandimby opened this issue Jun 2, 2023 · 4 comments
Closed

Python versions above 3.8 should not be reported as OK #26590

rakotomandimby opened this issue Jun 2, 2023 · 4 comments
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Installation question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@rakotomandimby
Copy link

rakotomandimby commented Jun 2, 2023

Describe the bug

On rolling releases Linux systems, where Python is regularily updated to the latest version, the BASH install script reports, for example Python version 3.11.3 to be OK:

[mihamina@arch-00 ~]$ curl -L https://aka.ms/InstallAzureCli | bash
[...]
Running install script.
-- Verifying Python version.
-- Python version 3.11.3 okay.
[...]

This is currently wrong, because Az CLI installs virtualenv-16.7.11 which still uses the distutils module, which is hard deprecated: https://peps.python.org/pep-0632/

This leads to :

-- Executing: ['/usr/bin/python3', 'virtualenv.py', '--python', '/usr/bin/python3', '/home/mihamina/lib/azure-cli']
/tmp/tmpn0w4l6w9/virtualenv-16.7.11/virtualenv.py:24: 
    DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. 
    Use setuptools or check PEP 632 for potential alternatives
  import distutils.spawn

/tmp/tmpn0w4l6w9/virtualenv-16.7.11/virtualenv.py:25: 
    DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig

Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/mihamina/lib/azure-cli/bin/python3
Also creating executable in /home/mihamina/lib/azure-cli/bin/python
ERROR: The executable /home/mihamina/lib/azure-cli/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/usr' (should be '/home/mihamina/lib/azure-cli')
ERROR: virtualenv is not compatible with this system or executable

Related command

curl -L https://aka.ms/InstallAzureCli | bash

Errors

[mihamina@arch-00 ~]$ curl -L https://aka.ms/InstallAzureCli | bash
[...]
Running install script.
-- Verifying Python version.
-- Python version 3.11.3 okay.

[...]

-- Executing: ['/usr/bin/python3', 'virtualenv.py', '--python', '/usr/bin/python3', '/home/mihamina/lib/azure-cli']
/tmp/tmpn0w4l6w9/virtualenv-16.7.11/virtualenv.py:24: 
    DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. 
    Use setuptools or check PEP 632 for potential alternatives
  import distutils.spawn

/tmp/tmpn0w4l6w9/virtualenv-16.7.11/virtualenv.py:25: 
    DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig

Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/mihamina/lib/azure-cli/bin/python3
Also creating executable in /home/mihamina/lib/azure-cli/bin/python
ERROR: The executable /home/mihamina/lib/azure-cli/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/usr' (should be '/home/mihamina/lib/azure-cli')
ERROR: virtualenv is not compatible with this system or executable

Issue script & Debug output

[mihamina@arch-00 ~]$ curl -L https://aka.ms/InstallAzureCli | bash
[...]
Running install script.
-- Verifying Python version.
-- Python version 3.11.3 okay.

[...]

-- Executing: ['/usr/bin/python3', 'virtualenv.py', '--python', '/usr/bin/python3', '/home/mihamina/lib/azure-cli']
/tmp/tmpn0w4l6w9/virtualenv-16.7.11/virtualenv.py:24: 
    DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. 
    Use setuptools or check PEP 632 for potential alternatives
  import distutils.spawn

/tmp/tmpn0w4l6w9/virtualenv-16.7.11/virtualenv.py:25: 
    DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig

Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/mihamina/lib/azure-cli/bin/python3
Also creating executable in /home/mihamina/lib/azure-cli/bin/python
ERROR: The executable /home/mihamina/lib/azure-cli/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/usr' (should be '/home/mihamina/lib/azure-cli')
ERROR: virtualenv is not compatible with this system or executable

Expected behavior

Expectation is just that the install script executes.

Environment Summary

Az CLI cannot be installed.

Additional context

No response

@rakotomandimby rakotomandimby added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 2, 2023
@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Installation labels Jun 2, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 2, 2023

Thank you for opening this issue, we will look into it.

@ghost ghost assigned jiasli Jun 2, 2023
@yonzhan yonzhan added this to the Backlog milestone Jun 2, 2023
@yonzhan yonzhan added the Azure CLI Team The command of the issue is owned by Azure CLI team label Jun 2, 2023
@jiasli
Copy link
Member

jiasli commented Jun 5, 2023

I believe you are following https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=script, but this script is also almost "deprecated". You may use other approaches to install Azure CLI:

@rakotomandimby
Copy link
Author

@jiasli ,

I use ArchLinux, the package manager is Pacman, provid ethe package and I will use it.

Otherwise, if the code we are talking about is deprecated, we have to requalify this issue to "Mark this script or documentation as deprecated"

Or also, we can requalify this to "Update the documentation"

@rakotomandimby
Copy link
Author

@jiasli , Never mind: I will adopt the non-official new way https://mihamina.rktmb.org/2023/06/azurecli-custom-python.html

@yonzhan yonzhan added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Installation question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants