azure-cli: Installation of ML extension fails with pip error

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

Describe the bug When installing the Azure Machine Learning CLI extension, we see this error: ERROR: An error occurred. Pip failed with status code 1. Use --debug for more information.

Using the debug flag we see an error from cryptography: error: Can not find Rust compiler Building wheel for cryptography (PEP 517): finished with status ‘error’ ERROR: Failed building wheel for cryptography and pip._internal.exceptions.InstallationError: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly

To Reproduce Create a Dockerfile with these lines: FROM mcr.microsoft.com/azure-cli RUN az login RUN az extension add -n azure-cli-ml

Expected behavior ML CLI extension installs.

Environment summary Using base mcr.microsoft.com/azure-cli image.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (4 by maintainers)

Most upvoted comments

@aronchick this has been fixed in 2.3.1, you should no longer see this issue if you install the latest CLI extension version. Let us know if otherwise.

A new patch release whl has been made that should fix this issue. It pins the cryptography package to be compatible: az extension add -s https://azurecliext.blob.core.windows.net/release/azure_cli_ml-1.22.0.1-py3-none-any.whl -y

This has not yet been released to the general az extension add -n azure-cli-ml yet - we are working on that. In the meantime, you can use the above command instead to get the patch.

@aronchick using a M1 Mac or otherwise arm64 arch?

I have been able to work around the error by installing from within a Docker container with relevant folders volume mounted.

You may want to open a new issue given this one is closed and differs from the original cryptography compatibility issue.