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

Install script fails using Python 3.11.5 #27775

Closed
paulius-valiunas opened this issue Nov 6, 2023 · 4 comments
Closed

Install script fails using Python 3.11.5 #27775

paulius-valiunas opened this issue Nov 6, 2023 · 4 comments
Assignees
Labels
Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team Possible-Solution question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Milestone

Comments

@paulius-valiunas
Copy link

Describe the bug

The installer crashes with a virtualenv error.

Related command

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

Errors

$ curl -L https://aka.ms/InstallAzureCli | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1405  100  1405    0     0    953      0  0:00:01  0:00:01 --:--:--  2554
Downloading Azure CLI install script from https://azurecliprod.blob.core.windows.net/install.py to /tmp/azure_cli_install_tmp_mMsONL.
######################################################################## 100.0%
/tmp/azure_cli_install_tmp_mMsONL: OK
Running install script.
-- Verifying Python version.
-- Python version 3.11.5 okay.
-- Verifying native dependencies.
-- Unable to verify native dependencies. dist=arch linux, version=20230723.0.166908. Continuing...

===> In what directory would you like to place the install? (leave blank to use '/home/paulius/lib/azure-cli'):
-- '/home/paulius/lib/azure-cli' is not empty and may contain a previous installation.

===> Remove this directory? (y/N): y
-- Deleted '/home/paulius/lib/azure-cli'.
-- Creating directory '/home/paulius/lib/azure-cli'.
-- We will install at '/home/paulius/lib/azure-cli'.

===> In what directory would you like to place the 'az' executable? (leave blank to use '/home/paulius/bin'):
-- The executable will be in '/home/paulius/bin'.
-- Downloading virtualenv package from https://pypi.python.org/packages/source/v/virtualenv/virtualenv-16.7.11.tar.gz.
-- Downloaded virtualenv package to /tmp/tmp1dna4do2/virtualenv-16.7.11.tar.gz.
-- Checksum of /tmp/tmp1dna4do2/virtualenv-16.7.11.tar.gz OK.
-- Extracting '/tmp/tmp1dna4do2/virtualenv-16.7.11.tar.gz' to '/tmp/tmp1dna4do2'.
-- Executing: ['/usr/sbin/python3', 'virtualenv.py', '--python', '/usr/sbin/python3', '/home/paulius/lib/azure-cli']
/tmp/tmp1dna4do2/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/tmp1dna4do2/virtualenv-16.7.11/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Already using interpreter /usr/sbin/python3
Using base prefix '/usr'
New python executable in /home/paulius/lib/azure-cli/bin/python3
Also creating executable in /home/paulius/lib/azure-cli/bin/python
ERROR: The executable /home/paulius/lib/azure-cli/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/usr' (should be '/home/paulius/lib/azure-cli')
ERROR: virtualenv is not compatible with this system or executable
Traceback (most recent call last):
  File "/tmp/azure_cli_install_tmp_mMsONL", line 415, in <module>
    main()
  File "/tmp/azure_cli_install_tmp_mMsONL", line 399, in main
    create_virtualenv(tmp_dir, install_dir)
  File "/tmp/azure_cli_install_tmp_mMsONL", line 144, in create_virtualenv
    exec_command(cmd, cwd=working_dir)
  File "/tmp/azure_cli_install_tmp_mMsONL", line 105, in exec_command
    subprocess.check_call(command_list, cwd=cwd, env=env)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/python3', 'virtualenv.py', '--python', '/usr/sbin/python3', '/home/paulius/lib/azure-cli']' returned non-zero exit status 100.

Issue script & Debug output

$ curl -L https://aka.ms/InstallAzureCli | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1405  100  1405    0     0    796      0  0:00:01  0:00:01 --:--:--  3776
Downloading Azure CLI install script from https://azurecliprod.blob.core.windows.net/install.py to /tmp/azure_cli_install_tmp_ePek9t.
######################################################################## 100.0%
/tmp/azure_cli_install_tmp_ePek9t: OK
Running install script.
-- Verifying Python version.
-- Python version 3.11.5 okay.
-- Verifying native dependencies.
-- Unable to verify native dependencies. dist=arch linux, version=20230723.0.166908. Continuing...

===> In what directory would you like to place the install? (leave blank to use '/home/paulius/lib/azure-cli'):
-- '/home/paulius/lib/azure-cli' is not empty and may contain a previous installation.

===> Remove this directory? (y/N): y
-- Deleted '/home/paulius/lib/azure-cli'.
-- Creating directory '/home/paulius/lib/azure-cli'.
-- We will install at '/home/paulius/lib/azure-cli'.

===> In what directory would you like to place the 'az' executable? (leave blank to use '/home/paulius/bin'):
-- The executable will be in '/home/paulius/bin'.
-- Downloading virtualenv package from https://pypi.python.org/packages/source/v/virtualenv/virtualenv-16.7.11.tar.gz.
-- Downloaded virtualenv package to /tmp/tmpe40xqqpx/virtualenv-16.7.11.tar.gz.
-- Checksum of /tmp/tmpe40xqqpx/virtualenv-16.7.11.tar.gz OK.
-- Extracting '/tmp/tmpe40xqqpx/virtualenv-16.7.11.tar.gz' to '/tmp/tmpe40xqqpx'.
-- Executing: ['/usr/sbin/python3', 'virtualenv.py', '--python', '/usr/sbin/python3', '/home/paulius/lib/azure-cli']
/tmp/tmpe40xqqpx/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/tmpe40xqqpx/virtualenv-16.7.11/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Already using interpreter /usr/sbin/python3
Using base prefix '/usr'
New python executable in /home/paulius/lib/azure-cli/bin/python3
Also creating executable in /home/paulius/lib/azure-cli/bin/python
ERROR: The executable /home/paulius/lib/azure-cli/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/usr' (should be '/home/paulius/lib/azure-cli')
ERROR: virtualenv is not compatible with this system or executable
Traceback (most recent call last):
  File "/tmp/azure_cli_install_tmp_ePek9t", line 415, in <module>
    main()
  File "/tmp/azure_cli_install_tmp_ePek9t", line 399, in main
    create_virtualenv(tmp_dir, install_dir)
  File "/tmp/azure_cli_install_tmp_ePek9t", line 144, in create_virtualenv
    exec_command(cmd, cwd=working_dir)
  File "/tmp/azure_cli_install_tmp_ePek9t", line 105, in exec_command
    subprocess.check_call(command_list, cwd=cwd, env=env)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/python3', 'virtualenv.py', '--python', '/usr/sbin/python3', '/home/paulius/lib/azure-cli']' returned non-zero exit status 100.
[paulius@AAD68995 ~]$ curl -L https://aka.ms/InstallAzureCli > az.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1405  100  1405    0     0    960      0  0:00:01  0:00:01 --:--:--     0
[paulius@AAD68995 ~]$ bash az.sh --debug
Downloading Azure CLI install script from https://azurecliprod.blob.core.windows.net/install.py to /tmp/azure_cli_install_tmp_Nea8rs.
################################################################################################################# 100.0%
/tmp/azure_cli_install_tmp_Nea8rs: OK
Running install script.
-- Verifying Python version.
-- Python version 3.11.5 okay.
-- Verifying native dependencies.
-- Unable to verify native dependencies. dist=arch linux, version=20230723.0.166908. Continuing...

===> In what directory would you like to place the install? (leave blank to use '/home/paulius/lib/azure-cli'):
-- '/home/paulius/lib/azure-cli' is not empty and may contain a previous installation.

===> Remove this directory? (y/N): y
-- Deleted '/home/paulius/lib/azure-cli'.
-- Creating directory '/home/paulius/lib/azure-cli'.
-- We will install at '/home/paulius/lib/azure-cli'.

===> In what directory would you like to place the 'az' executable? (leave blank to use '/home/paulius/bin'):
-- The executable will be in '/home/paulius/bin'.
-- Downloading virtualenv package from https://pypi.python.org/packages/source/v/virtualenv/virtualenv-16.7.11.tar.gz.
-- Downloaded virtualenv package to /tmp/tmp2x73wb10/virtualenv-16.7.11.tar.gz.
-- Checksum of /tmp/tmp2x73wb10/virtualenv-16.7.11.tar.gz OK.
-- Extracting '/tmp/tmp2x73wb10/virtualenv-16.7.11.tar.gz' to '/tmp/tmp2x73wb10'.
-- Executing: ['/usr/sbin/python3', 'virtualenv.py', '--python', '/usr/sbin/python3', '/home/paulius/lib/azure-cli']
/tmp/tmp2x73wb10/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/tmp2x73wb10/virtualenv-16.7.11/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
Already using interpreter /usr/sbin/python3
Using base prefix '/usr'
New python executable in /home/paulius/lib/azure-cli/bin/python3
Also creating executable in /home/paulius/lib/azure-cli/bin/python
ERROR: The executable /home/paulius/lib/azure-cli/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/usr' (should be '/home/paulius/lib/azure-cli')
ERROR: virtualenv is not compatible with this system or executable
Traceback (most recent call last):
  File "/tmp/azure_cli_install_tmp_Nea8rs", line 415, in <module>
    main()
  File "/tmp/azure_cli_install_tmp_Nea8rs", line 399, in main
    create_virtualenv(tmp_dir, install_dir)
  File "/tmp/azure_cli_install_tmp_Nea8rs", line 144, in create_virtualenv
    exec_command(cmd, cwd=working_dir)
  File "/tmp/azure_cli_install_tmp_Nea8rs", line 105, in exec_command
    subprocess.check_call(command_list, cwd=cwd, env=env)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/sbin/python3', 'virtualenv.py', '--python', '/usr/sbin/python3', '/home/paulius/lib/azure-cli']' returned non-zero exit status 100.

Expected behavior

should install az

Environment Summary

none, I can't install az

Additional context

No response

@paulius-valiunas paulius-valiunas added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 6, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 6, 2023

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

Copy link

Hi @paulius-valiunas
Find similar issue #23215.

Issue title Virtualenv step failing in install script
Create time 2022-07-15
Comment number 2

Possible solution:
According to the previous issue, the problem is caused by the virtualenv package. The virtualenv package is not compatible with the system or executable. The error message indicates that the filename does not start with any of the prefixes. One solution is to install azure-cli with pip. You can use this guide to install azure-cli with pip: #20476.


Please confirm if this resolves your issue.

@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team 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 Nov 6, 2023
@yonzhan yonzhan added this to the Backlog milestone Nov 6, 2023
@bebound
Copy link
Contributor

bebound commented Nov 7, 2023

This script is not maintained for a long time, please follow this guide to install azure-cli with pip: #20476

@bebound bebound closed this as completed Nov 7, 2023
@paulius-valiunas
Copy link
Author

This script is not maintained for a long time, please follow this guide to install azure-cli with pip: #20476

then remove it from the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Resolve Auto resolve by bot Azure CLI Team The command of the issue is owned by Azure CLI team Possible-Solution question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Projects
None yet
Development

No branches or pull requests

3 participants