Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3k forks source link

rdbms-connect install fails with pip status code 2 #25188

Open Kirkius opened 1 year ago

Kirkius commented 1 year ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

az extension add --name rdbms-connect

Describe the bug

Trying to install the rdbms-connect extension fails and retuns pip failed with status code 2. By running the above command with the --debug flag I saw that the module poetry was not found. Manually installing poetry with pip install poetry fixed the bug. (See additional context for relevant debug output)

To Reproduce

Run az extension add --name rdbms-connect on a clean macOS 12.6.2 environment.

Expected behavior

The rdbms-connect extension gets installed with having to manually install a dependency.

Environment summary

Install method: az extension add --name rdbms-connect OS Version: macOS Monterey v12.6.2 az version: 2.44.1 python version: 3.10.9 pip version: 22.3.1 shell type: zsh (oh-my-zsh)

Additional context

 Installing build dependencies: started
  Running command pip subprocess to install build dependencies
  Using pip 22.3.1 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)
  Collecting poetry-core>=1.0.0a9
    Using cached poetry_core-1.4.0-py3-none-any.whl (546 kB)
  Installing collected packages: poetry-core
  Successfully installed poetry-core-1.4.0
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Running command Getting requirements to build wheel
  Error in sitecustomize; set PYTHONVERBOSE for traceback:
  AssertionError:
  Getting requirements to build wheel: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
    status = run_func(*args)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
    return func(self, options, args)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 400, in run
    requirement_set = resolver.resolve(
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 373, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 213, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 204, in _get_updated_criteria
    self._add_to_criteria(criteria, requirement, parent=candidate)
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
    if not criterion.candidates:
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/resolvelib/structs.py", line 151, in __bool__
    return bool(self._sequence)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
    return any(self)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
    candidate = func()
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 297, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 162, in __init__
    self.dist = self._prepare()
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 231, in _prepare
    dist = self._prepare_distribution()
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 308, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 491, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 577, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 69, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 48, in prepare_distribution_metadata
    self._install_build_reqs(finder)
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 118, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 95, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
  File "/usr/local/lib/python3.10/site-packages/pip/_internal/utils/misc.py", line 685, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/wrappers.py", line 173, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/wrappers.py", line 319, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
  File "/usr/local/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'poetry'

Removed pendulum>=2.1.0 from https://files.pythonhosted.org/packages/db/15/6e89ae7cde7907118769ed3d2481566d05b5fd362724025198bb95faf599/pendulum-2.1.2.tar.gz (from pgcli==3.4.1->rdbms-connect==1.0.4) from build tracker '/private/var/folders/gb/xy80xqy537s7s6pzw3nhs67jxgqs03/T/pip-build-tracker-j82w7tlk'
Removed build tracker: '/private/var/folders/gb/xy80xqy537s7s6pzw3nhs67jxgqs03/T/pip-build-tracker-j82w7tlk'

cli.azure.cli.core.extension.operations: Command '['/usr/local/opt/python@3.10/bin/python3.10', '-m', 'pip', 'install', '--target', '/Users/c.vd.kerk/.azure/cliextensions/rdbms-connect', '/var/folders/gb/xy80xqy537s7s6pzw3nhs67jxgqs03/T/tmp0lv47wda/rdbms_connect-1.0.4-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 2.
cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at /Users/c.vd.kerk/.azure/cliextensions/rdbms-connect
cli.azure.cli.core.util: azure.cli.core.util.handle_exception is called with an exception:
cli.azure.cli.core.util: Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/lib/python3.10/site-packages/azure/cli/command_modules/extension/custom.py", line 16, in add_extension_cmd
    return add_extension(cli_ctx=cmd.cli_ctx, source=source, extension_name=extension_name, index_url=index_url,
  File "/usr/local/lib/python3.10/site-packages/azure/cli/core/extension/operations.py", line 344, in add_extension
    extension_name = _add_whl_ext(cli_ctx=cmd_cli_ctx, source=source, ext_sha256=ext_sha256,
  File "/usr/local/lib/python3.10/site-packages/azure/cli/core/extension/operations.py", line 173, in _add_whl_ext
    raise CLIError('An error occurred. Pip failed with status code {}. '
knack.util.CLIError: An error occurred. Pip failed with status code 2. Use --debug for more information.

cli.azure.cli.core.azclierror: An error occurred. Pip failed with status code 2. Use --debug for more information.
az_command_data_logger: An error occurred. Pip failed with status code 2. Use --debug for more information.
yonzhan commented 1 year ago

@bebound for awareness

bebound commented 1 year ago

I can't repro. I'm using MacOS 13.1 ARM64. The extension is installed without error, and I don't have poetry in Python.

Thanks for your report. If anyone meet the same error, he can try your advice: pip install poetry.

ghost commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

nschoenberg commented 1 year ago

I've the same issue on my windows machine and in azure pipelines. This is my shrinked output because comment length limit

command: az extension add --upgrade -n rdbms-connect --debug

output tail:

  Skipping link: none of the wheel's tags (cp39-cp39-manylinux1_x86_64, cp39-cp39-manylinux2014_x86_64, cp39-cp39-manylinux_2_17_x86_64, cp39-cp39-manylinux_2_5_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/b6/e9/f59e26c8dd60db5526c1bb473cb8ce8debe4cddc199f1b01c002811edd53/pendulum-3.0.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (cp39-cp39-musllinux_1_1_i686) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/e5/b2/1021b52f54b58529707fb0fffec801b91ce10b775597140485bdac818e92/pendulum-3.0.0a1-cp39-cp39-musllinux_1_1_i686.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (cp39-cp39-musllinux_1_1_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/56/0b/bb15cc7014cdbf7f7842e754360a3d67372458f9573a7c65dbacca84cb0b/pendulum-3.0.0a1-cp39-cp39-musllinux_1_1_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (cp39-cp39-win32) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/c2/2c/a5cc3f7ad9cffae98a98cc3792147650604f7a4df7dc398194a80ba1b956/pendulum-3.0.0a1-cp39-cp39-win32.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (cp39-cp39-win_amd64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/5a/f5/f268694f6fed285aeaf7e3892ae35f79139fdc4081e94428841a35eaaf1f/pendulum-3.0.0a1-cp39-cp39-win_amd64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp37-pypy37_pp73-macosx_12_0_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/1b/a1/68ffd9938d79a8d00a0fc6bed89e4039f309e87e5e1cd3c9a5d021f8ab54/pendulum-3.0.0a1-pp37-pypy37_pp73-macosx_12_0_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp37-pypy37_pp73-manylinux1_i686, pp37-pypy37_pp73-manylinux2014_i686, pp37-pypy37_pp73-manylinux_2_17_i686, pp37-pypy37_pp73-manylinux_2_5_i686) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/ce/18/9b9183d838f95437c073c2e5018d3cb4e4dbb0af9d791fffa93ae025cb5d/pendulum-3.0.0a1-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp37-pypy37_pp73-manylinux1_x86_64, pp37-pypy37_pp73-manylinux2014_x86_64, pp37-pypy37_pp73-manylinux_2_17_x86_64, pp37-pypy37_pp73-manylinux_2_5_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/3b/e6/4e6ead0a1f86b129ce7a93af3cff922da5366c79b07538cd50fb3760fe3e/pendulum-3.0.0a1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp37-pypy37_pp73-win_amd64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/75/05/12a364c7c3be068bbbfb5236f03e2c9c41a26eae1317984f8f71600fe802/pendulum-3.0.0a1-pp37-pypy37_pp73-win_amd64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp38-pypy38_pp73-macosx_12_0_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/0a/ae/c5faa98a8928730c49e3589935602a929af4a2796ddd164a0c044c9681ca/pendulum-3.0.0a1-pp38-pypy38_pp73-macosx_12_0_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp38-pypy38_pp73-manylinux1_i686, pp38-pypy38_pp73-manylinux2014_i686, pp38-pypy38_pp73-manylinux_2_17_i686, pp38-pypy38_pp73-manylinux_2_5_i686) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/62/d4/ff4f2b5f905286e1d802662bf2cf4cf723f0cddbd460af6295fc3911e0cb/pendulum-3.0.0a1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp38-pypy38_pp73-manylinux1_x86_64, pp38-pypy38_pp73-manylinux2014_x86_64, pp38-pypy38_pp73-manylinux_2_17_x86_64, pp38-pypy38_pp73-manylinux_2_5_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/a5/b8/6564c85608e3f7eed70b1d9aa09130d1efcbdfd4ed32b623c0c5870534c0/pendulum-3.0.0a1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp38-pypy38_pp73-win_amd64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/16/b4/bda56027abbbc2f8ece8e489a20b940e76d8547a25d62dbe791f2190592b/pendulum-3.0.0a1-pp38-pypy38_pp73-win_amd64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp39-pypy39_pp73-macosx_12_0_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/04/51/3be4b7ac0705bf905b124ec07be75e9e6afa9a82cfcf06785f28f55adc51/pendulum-3.0.0a1-pp39-pypy39_pp73-macosx_12_0_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp39-pypy39_pp73-manylinux1_i686, pp39-pypy39_pp73-manylinux2014_i686, pp39-pypy39_pp73-manylinux_2_17_i686, pp39-pypy39_pp73-manylinux_2_5_i686) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/e8/68/ea2308a91188d70d9d6ebba3391e88d496f475a40005d0175e028a036ace/pendulum-3.0.0a1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp39-pypy39_pp73-manylinux1_x86_64, pp39-pypy39_pp73-manylinux2014_x86_64, pp39-pypy39_pp73-manylinux_2_17_x86_64, pp39-pypy39_pp73-manylinux_2_5_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/e2/6e/3dfd378e2381143b03a4ddfebe2970b2984bf8eaaef9130b67e08c192ccb/pendulum-3.0.0a1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Skipping link: none of the wheel's tags (pp39-pypy39_pp73-win_amd64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/eb/b6/94f74b7ff3a954e6784448712d63b6fa07ec6453a7aaa062afb63ccf70e2/pendulum-3.0.0a1-pp39-pypy39_pp73-win_amd64.whl (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0)
  Found link https://files.pythonhosted.org/packages/b2/f2/3d3fa543970f436a0b05dd6d4c75ddc06c6992ba480ffe94c329c75ff4bf/pendulum-3.0.0a1.tar.gz (from https://pypi.org/simple/pendulum/) (requires-python:>=3.7,<4.0), version: 3.0.0a1
Skipping link: not a file: https://pypi.org/simple/pendulum/
Given no hashes to check 3 links for project 'pendulum': discarding no candidates
Collecting pendulum>=2.1.0 (from pgcli==3.4.1->rdbms-connect==1.0.4)
  Created temporary directory: C:\Users\nschoenberg\AppData\Local\Temp\pip-unpack-pwr18w7w
  https://files.pythonhosted.org:443 "GET /packages/db/15/6e89ae7cde7907118769ed3d2481566d05b5fd362724025198bb95faf599/pendulum-2.1.2.tar.gz HTTP/1.1" 200 81167
  Downloading pendulum-2.1.2.tar.gz (81 kB)
     ---------------------------------------- 81.2/81.2 kB ? eta 0:00:00
  Added pendulum>=2.1.0 from https://files.pythonhosted.org/packages/db/15/6e89ae7cde7907118769ed3d2481566d05b5fd362724025198bb95faf599/pendulum-2.1.2.tar.gz (from pgcli==3.4.1->rdbms-connect==1.0.4) to build tracker 'C:\\Users\\nschoenberg\\AppData\\Local\\Temp\\pip-build-tracker-utee1jnz'
  Created temporary directory: C:\Users\nschoenberg\AppData\Local\Temp\pip-build-env-jja1v9jf
  Installing build dependencies: started
  Running command pip subprocess to install build dependencies
  Using pip 23.1.2 from C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\pip (python 3.10)
  Collecting poetry-core>=1.0.0a9
    Using cached poetry_core-1.6.1-py3-none-any.whl (450 kB)
  Installing collected packages: poetry-core
  Successfully installed poetry-core-1.6.1
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Running command Getting requirements to build wheel
  Getting requirements to build wheel: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\cli\base_command.py", line 169, in exc_logging_wrapper
    status = run_func(*args)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\cli\req_command.py", line 248, in wrapper
    return func(self, options, args)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\commands\install.py", line 377, in run
    requirement_set = resolver.resolve(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 230, in _get_updated_criteria
    self._add_to_criteria(criteria, requirement, parent=candidate)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 156, in __bool__
    return bool(self._sequence)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 155, in __bool__
    return any(self)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 47, in _iter_built
    candidate = func()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 206, in _make_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 293, in __init__
    super().__init__(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 156, in __init__
    self.dist = self._prepare()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 225, in _prepare
    dist = self._prepare_distribution()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 304, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\operations\prepare.py", line 516, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\operations\prepare.py", line 631, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\operations\prepare.py", line 69, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\distributions\sdist.py", line 48, in prepare_distribution_metadata
    self._install_build_reqs(finder)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\distributions\sdist.py", line 118, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\distributions\sdist.py", line 95, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_internal\utils\misc.py", line 692, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 321, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\nschoenberg\AppData\Local\Temp\pip-build-env-jja1v9jf\overlay\Lib\site-packages\poetry\core\masonry\api.py", line 11, in <module>
    from poetry.core.factory import Factory
  File "C:\Users\nschoenberg\AppData\Local\Temp\pip-build-env-jja1v9jf\overlay\Lib\site-packages\poetry\core\factory.py", line 15, in <module>
    from poetry.core.utils.helpers import combine_unicode
  File "C:\Users\nschoenberg\AppData\Local\Temp\pip-build-env-jja1v9jf\overlay\Lib\site-packages\poetry\core\utils\helpers.py", line 9, in <module>
    import unicodedata
ModuleNotFoundError: No module named 'unicodedata'

Removed pendulum>=2.1.0 from https://files.pythonhosted.org/packages/db/15/6e89ae7cde7907118769ed3d2481566d05b5fd362724025198bb95faf599/pendulum-2.1.2.tar.gz (from pgcli==3.4.1->rdbms-connect==1.0.4) from build tracker 'C:\\Users\\nschoenberg\\AppData\\Local\\Temp\\pip-build-tracker-utee1jnz'
Removed build tracker: 'C:\\Users\\nschoenberg\\AppData\\Local\\Temp\\pip-build-tracker-utee1jnz'

DEBUG: cli.azure.cli.core.extension.operations: Command '['C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI2\\python.exe', '-m', 'pip', 'install', '--target', 'C:\\Users\\nschoenberg\\.azure\\cliextensions\\rdbms-connect', 'C:\\Users\\NSCHOE~1\\AppData\\Local\\Temp\\tmpm3lug3e8\\rdbms_connect-1.0.4-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 2.
DEBUG: cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at C:\Users\nschoenberg\.azure\cliextensions\rdbms-connect
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/extension/custom.py", line 16, in add_extension_cmd
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/extension/operations.py", line 344, in add_extension
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/extension/operations.py", line 173, in _add_whl_ext
knack.util.CLIError: An error occurred. Pip failed with status code 2. Use --debug for more information.

ERROR: cli.azure.cli.core.azclierror: An error occurred. Pip failed with status code 2. Use --debug for more information.
ERROR: az_command_data_logger: An error occurred. Pip failed with status code 2. Use --debug for more information.
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x040AB6E8>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.__main__: Command ran in 13.037 seconds (init: 0.313, invoke: 12.723)
INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
INFO: telemetry.client: Accumulated 0 events. Flush the clients.
INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
INFO: telemetry.save: Save telemetry record of length 3547 in cache
WARNING: telemetry.check: Negative: The C:\Users\nschoenberg\.azure\telemetry.txt was modified at 2023-07-07 14:14:09.501765, which in less than 600.000000 
bebound commented 1 year ago

@nschoenberg Please see https://github.com/Azure/azure-cli/issues/25067

jupiter19914 commented 1 year ago

I have same issue on Windows.

pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last): File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 77, in _build_backend obj = import_module(mod_path) File "importlib__init__.py", line 126, in import_module File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\joguerin\AppData\Local\Temp\pip-build-env-vswol2xo\overlay\Lib\site-packages\poetry\core\masonry\api.py", line 11, in from poetry.core.factory import Factory File "C:\Users\joguerin\AppData\Local\Temp\pip-build-env-vswol2xo\overlay\Lib\site-packages\poetry\core\factory.py", line 15, in from poetry.core.utils.helpers import combine_unicode File "C:\Users\joguerin\AppData\Local\Temp\pip-build-env-vswol2xo\overlay\Lib\site-packages\poetry\core\utils\helpers.py", line 9, in import unicodedata ModuleNotFoundError: No module named 'unicodedata'

Removed pendulum>=2.1.0 from https://files.pythonhosted.org/packages/db/15/6e89ae7cde7907118769ed3d2481566d05b5fd362724025198bb95faf599/pendulum-2.1.2.tar.gz (from pgcli==3.4.1->rdbms-connect==1.0.4) from build tracker 'C:\Users\joguerin\AppData\Local\Temp\pip-build-tracker-pdhzelst' Removed build tracker: 'C:\Users\joguerin\AppData\Local\Temp\pip-build-tracker-pdhzelst'

DEBUG: cli.azure.cli.core.extension.operations: Command '['C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe', '-m', 'pip', 'install', '--target', 'C:\Users\joguerin\.azure\cliextensions\rdbms-connect', 'C:\Users\joguerin\AppData\Local\Temp\tmpzbz1nvtl\rdbms_connect-1.0.4-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 2. DEBUG: cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at C:\Users\joguerin.azure\cliextensions\rdbms-connect DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/extension/custom.py", line 16, in add_extension_cmd File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/extension/operations.py", line 344, in add_extension File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/extension/operations.py", line 173, in _add_whl_ext knack.util.CLIError: An error occurred. Pip failed with status code 2. Use --debug for more information.

ERROR: cli.azure.cli.core.azclierror: An error occurred. Pip failed with status code 2. Use --debug for more information. ERROR: az_command_data_logger: An error occurred. Pip failed with status code 2. Use --debug for more information. DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x0406A6A0>] INFO: az_command_data_logger: exit code: 1 INFO: cli.main: Command ran in 20.028 seconds (init: 0.965, invoke: 19.063) INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1 INFO: telemetry.client: Accumulated 0 events. Flush the clients. INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1 INFO: telemetry.save: Save telemetry record of length 3483 in cache INFO: telemetry.main: Begin creating telemetry upload process. INFO: telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry__init__.pyc C:\Users\joguerin.azure" INFO: telemetry.process: Return from creating process INFO: telemetry.main: Finish creating telemetry upload process.