Skip to content

Python get_path error after updating to 2.60.0 #28878

@davidbgonz

Description

@davidbgonz

Describe the bug

Any az commands result in a python error.

Related command

Any az command including just running az and az --help

Errors

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/__main__.py", line 39, in <module>
    az_cli = get_default_cli()
             ^^^^^^^^^^^^^^^^^
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/__init__.py", line 917, in get_default_cli
    from azure.cli.core.azlogging import AzCliLogging
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/azlogging.py", line 30, in <module>
    from azure.cli.core.commands.events import EVENT_INVOKER_PRE_CMD_TBL_TRUNCATE
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 25, in <module>
    from azure.cli.core.extension import get_extension
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/extension/__init__.py", line 25, in <module>
    EXTENSIONS_SYS_DIR = os.path.expanduser(_CUSTOM_EXT_SYS_DIR) if _CUSTOM_EXT_SYS_DIR else os.path.join(get_path("purepath"), 'azure-cli-extensions')
                                                                                                          ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/sysconfig.py", line 636, in get_path
    return get_paths(scheme, vars, expand)[name]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'purepath'

Issue script & Debug output

Any command with the --debug flag still results in the above error.

Expected behavior

Since any command errors out, expected behavior is to at least make it passed that python error.

Environment Summary

Running az --version still results in the same error. I can use 2.59.0 and update the azure-cli and core versions manually below:

azure-cli                         2.60.0

core                              2.60.0
telemetry                          1.1.0

Extensions:
azure-devops                      0.26.0
ssh                                1.1.6

Dependencies:
msal                              1.28.0
azure-mgmt-resource             23.1.0b2

Python location '/opt/azure-cli/bin/python'
Extensions directory '/home/<user>/.azure/cliextensions'

Python (Linux) 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417]

Additional context

Pathlib was updated recently and have been experiencing other tools such as neovim extensions needing updates to reflect the new changes. This cloud be related to that, although 2.59.0 is still functional when I rollback to that version.

Metadata

Metadata

Assignees

Labels

Azure CLI TeamThe command of the issue is owned by Azure CLI teamPackagingcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions