Azure / azure-cli

Azure Command-Line Interface
MIT License
3.96k stars 2.94k forks source link

Installation of ML extension fails with pip error #16880

Closed jgtellez1 closed 3 years ago

jgtellez1 commented 3 years ago

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.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

Issue Details
> ### `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.
Author: jgtellez1
Assignees: -
Labels: `Machine Learning`, `Service Attention`, `needs-triage`, `question`
Milestone: -
yungezz commented 3 years ago

route to appropriate team

singankit commented 3 years ago

@yungezz The issue is happening only when using mcr.microsoft.com/azure-cli docker image. az ml extension installation done on local machine works fine. Looks like an issue with the image.

fengzhou-msft commented 3 years ago

It's caused by the latest version of cryptography as described in https://github.com/Azure/azure-cli/issues/16858 It's related to whether the underlying platform supports rust.

azure-cli currently pinned cryptography with 'cryptography>=2.3.1,<3.0.0', but azure-ml-cli relies on adal and it depends on cryptography with no version upper bound. When installing the azure-ml-cli extension, it will try to install the latest version of cryptography.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @lostmygithubaccount.

Issue Details
> ### `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.
Author: jgtellez1
Assignees: -
Labels: `ML-MLOps`, `Machine Learning`, `Packaging`, `Service Attention`
Milestone: -
j-so commented 3 years ago

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.

missa112 commented 3 years ago

Help please, I can not install "pip3 install pgpy" on Centos 7, an error occurs.

Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-_lndkep4/cryptography/setup.py", line 14, in from setuptools_rust import RustExtension ModuleNotFoundError: No module named 'setuptools_rust'

What to do?

singankit commented 3 years ago

Hopefully pinning cryptography package to an older version <3.3.2 should help.

yungezz commented 3 years ago

there's security issue in cryptography <3.2.2, https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst#332---2021-02-07. We're working on upgrade crypotography to >=3.2.2

fengzhou-msft commented 3 years ago

The issues is fixed with the new version of azure-cli-ml.

fer-git commented 2 years ago

I am still having this issue. I am using mac osx 12.1 with azure-cli 2.31.0 The azure-cli is installed with homebrew brew update && brew install azure-cli. Then I run the command az extension add -n ml -y

  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/opt/homebrew/Cellar/azure-cli/2.31.0/libexec/include -I/opt/homebrew/Cellar/python@3.10/3.10.1/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c build/temp.macosx-12-arm64-3.10/_openssl.c -o build/temp.macosx-12-arm64-3.10/build/temp.macosx-12-arm64-3.10/_openssl.o -Wconversion -Wno-error=sign-conversion
  build/temp.macosx-12-arm64-3.10/_openssl.c:575:10: fatal error: 'openssl/opensslv.h' file not found
  #include <openssl/opensslv.h>
           ^~~~~~~~~~~~~~~~~~~~
  1 error generated.

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) Read https://cryptography.io/en/latest/installation.html for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq.html
      =============================DEBUG ASSISTANCE=============================

  error: command '/usr/bin/clang' failed with exit code 1
  Building wheel for cryptography (PEP 517): finished with status 'error'
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/opt/homebrew/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
    return func(self, options, args)
  File "/opt/homebrew/Cellar/azure-cli/2.31.0/libexec/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 357, in run
    raise InstallationError(
pip._internal.exceptions.InstallationError: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
Removed build tracker: '/private/tmp/pip-req-tracker-g2i374bn'

cli.azure.cli.core.extension.operations: Command '['/opt/homebrew/Cellar/azure-cli/2.31.0/libexec/bin/python', '-m', 'pip', 'install', '--target', '/Users/username/.azure/cliextensions/ml', '/tmp/tmpgt47ozge/ml-2.0.3-py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1.
j0rd1smit commented 2 years ago

I'm also still having this issues

jbesomi commented 2 years ago

Same problem here, I tried to install az ml with the following command az extension add -n ml -y. Azure CLI version: 2.34.1 (the latest version). Python version: Python 3.8.11. Pip version: 21.2.4.

@fengzhou-msft can you please re-open this issue and look into that? I believe a lot of users with a new generation M1/M2 Apple's processor will have the same problem.

FYI I can install the latest version of cryptography just with pip install cryptography without issues. Yet, during the installation of az ml, it probably tries to install cryptography again for a specific version with unsupported wheels (pip._internal.exceptions.InstallationError: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects).

Thanks!

Here the relevant logs obtained with az extension add -n ml -y --debug:

Created temporary directory: /private/var/folders/dd/_pvc38hx5vx9846yqjcd9wl80000gn/T/pip-unpack-0ietpw6b
Building wheels for collected packages: cryptography
  Created temporary directory: /private/var/folders/dd/_pvc38hx5vx9846yqjcd9wl80000gn/T/pip-wheel-r25gg8ce
  Destination directory: /private/var/folders/dd/_pvc38hx5vx9846yqjcd9wl80000gn/T/pip-wheel-r25gg8ce
  Building wheel for cryptography (pyproject.toml): started
  Running command Building wheel for cryptography (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  running egg_info
  writing src/cryptography.egg-info/PKG-INFO
  writing dependency_links to src/cryptography.egg-info/dependency_links.txt
  writing requirements to src/cryptography.egg-info/requires.txt
  writing top-level names to src/cryptography.egg-info/top_level.txt
  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files found matching 'vectors'
  warning: no previously-included files matching '*' found under directory 'vectors'
  warning: no previously-included files matching '*' found under directory '.github'
  warning: no previously-included files found matching 'release.py'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching 'codecov.yml'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'dev-requirements.txt'
  warning: no previously-included files found matching 'rtd-requirements.txt'
  warning: no previously-included files found matching 'tox.ini'
  warning: no previously-included files matching '*' found under directory '.zuul.d'
  warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
  adding license file 'LICENSE'
  adding license file 'LICENSE.APACHE'
  adding license file 'LICENSE.BSD'
  adding license file 'LICENSE.PSF'
  adding license file 'AUTHORS.rst'
  running build_ext
  generating cffi module 'build/temp.macosx-12-arm64-3.10/_padding.c'
  generating cffi module 'build/temp.macosx-12-arm64-3.10/_openssl.c'
  building '_openssl' extension
  build/temp.macosx-12-arm64-3.10/_openssl.c:575:10: fatal error: 'openssl/opensslv.h' file not found
  #include <openssl/opensslv.h>
           ^~~~~~~~~~~~~~~~~~~~
  1 error generated.

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:
      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) Read https://cryptography.io/en/latest/installation.html for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq.html
      =============================DEBUG ASSISTANCE=============================

  error: command '/usr/bin/clang' failed with exit code 1
  error: subprocess-exited-with-error

  × Building wheel for cryptography (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /opt/homebrew/Cellar/azure-cli/2.34.1/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/dd/_pvc38hx5vx9846yqjcd9wl80000gn/T/tmpjn2y1rw6
  cwd: /private/var/folders/dd/_pvc38hx5vx9846yqjcd9wl80000gn/T/pip-install-hug_j7b_/cryptography_56e293beda3944f0af2b32ba8877e66c
  Building wheel for cryptography (pyproject.toml): finished with status 'error'
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
Exception information:
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 165, in exc_logging_wrapper
    status = run_func(*args)
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 375, in run
    raise InstallationError(
pip._internal.exceptions.InstallationError: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
Removed build tracker: '/private/var/folders/dd/_pvc38hx5vx9846yqjcd9wl80000gn/T/pip-req-tracker-jcgmidfo'

cli.azure.cli.core.extension.operations: Command '['/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/bin/python', '-m', 'pip', 'install', '--target', '/Users/jonathan/.azure/cliextensions/ml', '/var/folders/dd/_pvc38hx5vx9846yqjcd9wl80000gn/T/tmpic318qit/ml-2.1.2-py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1.
cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at /Users/jonathan/.azure/cliextensions/ml
cli.azure.cli.core.util: Failed to delete '/Users/jonathan/.azure/cliextensions/ml': [Errno 2] No such file or directory: '/Users/jonathan/.azure/cliextensions/ml'. Retrying ...
cli.azure.cli.core.util: Failed to delete '/Users/jonathan/.azure/cliextensions/ml': [Errno 2] No such file or directory: '/Users/jonathan/.azure/cliextensions/ml'. Retrying ...
cli.azure.cli.core.util: Failed to delete '/Users/jonathan/.azure/cliextensions/ml': [Errno 2] No such file or directory: '/Users/jonathan/.azure/cliextensions/ml'. Retrying ...
cli.azure.cli.core.util: Failed to delete '/Users/jonathan/.azure/cliextensions/ml': [Errno 2] No such file or directory: '/Users/jonathan/.azure/cliextensions/ml'. You may try to delete it manually.
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 "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/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 "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/lib/python3.10/site-packages/azure/cli/core/extension/operations.py", line 336, in add_extension
    extension_name = _add_whl_ext(cli_ctx=cmd_cli_ctx, source=source, ext_sha256=ext_sha256,
  File "/opt/homebrew/Cellar/azure-cli/2.34.1/libexec/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 1. Use --debug for more information.
andmck1 commented 2 years ago

I'm also having these issues! Exactly the same error as above.

harneetvirk commented 2 years ago

We are investigating this issue.

raja7592 commented 2 years ago

Hi @andmck1, I could not repro this issue, for me ML CLI extension was installed successfully. I have used the same docker file provided above in the issue and build it using progress plain option so that I can do "az login". Then I have bashed inside the image, I can see extension was added there.

aronchick commented 2 years ago

+1 - having this issue right now.


     ^

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:537:6: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:197:34: note: expanded from macro '_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT' defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1)) ^ 197 warnings generated. clang -bundle -undefined dynamic_lookup -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/daaronch/.pyenv/versions/3.8.12/lib -L/opt/homebrew/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/daaronch/.pyenv/versions/3.8.12/lib -L/opt/homebrew/lib -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib build/temp.macosx-12.0-arm64-3.8/c/_cffi_backend.o -lffi -o build/lib.macosx-12.0-arm64-3.8/_cffi_backend.cpython-38-darwin.so installing to build/bdist.macosx-12.0-arm64/wheel running install running install_lib creating build/bdist.macosx-12.0-arm64 creating build/bdist.macosx-12.0-arm64/wheel creating build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/_cffi_include.h -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/backend_ctypes.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/error.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/setuptools_ext.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/_cffi_errors.h -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/init.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/cffi_opcode.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/vengine_gen.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/pkgconfig.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/model.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/ffiplatform.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/api.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/vengine_cpy.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/_embedding.h -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/commontypes.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/lock.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/recompiler.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/cparser.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/verifier.py -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/cffi/parse_c_type.h -> build/bdist.macosx-12.0-arm64/wheel/cffi copying build/lib.macosx-12.0-arm64-3.8/_cffi_backend.cpython-38-darwin.so -> build/bdist.macosx-12.0-arm64/wheel running install_egg_info running egg_info writing cffi.egg-info/PKG-INFO writing dependency_links to cffi.egg-info/dependency_links.txt writing entry points to cffi.egg-info/entry_points.txt writing requirements to cffi.egg-info/requires.txt writing top-level names to cffi.egg-info/top_level.txt warning: the 'license_file' option is deprecated, use 'license_files' instead adding license file 'LICENSE' (matched pattern 'LICENSE') reading manifest file 'cffi.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'cffi.egg-info/SOURCES.txt' Copying cffi.egg-info to build/bdist.macosx-12.0-arm64/wheel/cffi-1.15.0-py3.8.egg-info running install_scripts creating build/bdist.macosx-12.0-arm64/wheel/cffi-1.15.0.dist-info/WHEEL creating '/private/var/folders/38/kszkvfx157q2qy4fm0gwzxpw0000gn/T/pip-wheel-kg36a3eh/cffi-1.15.0-cp38-cp38-macosx_12_0_arm64.whl' and adding 'build/bdist.macosx-12.0-arm64/wheel' to it adding '_cffi_backend.cpython-38-darwin.so' adding 'cffi/init.py' adding 'cffi/_cffi_errors.h' adding 'cffi/_cffi_include.h' adding 'cffi/_embedding.h' adding 'cffi/api.py' adding 'cffi/backend_ctypes.py' adding 'cffi/cffi_opcode.py' adding 'cffi/commontypes.py' adding 'cffi/cparser.py' adding 'cffi/error.py' adding 'cffi/ffiplatform.py' adding 'cffi/lock.py' adding 'cffi/model.py' adding 'cffi/parse_c_type.h' adding 'cffi/pkgconfig.py' adding 'cffi/recompiler.py' adding 'cffi/setuptools_ext.py' adding 'cffi/vengine_cpy.py' adding 'cffi/vengine_gen.py' adding 'cffi/verifier.py' adding 'cffi-1.15.0.dist-info/LICENSE' adding 'cffi-1.15.0.dist-info/METADATA' adding 'cffi-1.15.0.dist-info/WHEEL' adding 'cffi-1.15.0.dist-info/entry_points.txt' adding 'cffi-1.15.0.dist-info/top_level.txt' adding 'cffi-1.15.0.dist-info/RECORD' removing build/bdist.macosx-12.0-arm64/wheel Building wheel for cffi (setup.py): finished with status 'done' Created wheel for cffi: filename=cffi-1.15.0-cp38-cp38-macosx_12_0_arm64.whl size=174173 sha256=157e9130da5eddb51977d308ca6a53953fdaca4bb8d4609f6b3c91aa7b4fc552 Stored in directory: /private/var/folders/38/kszkvfx157q2qy4fm0gwzxpw0000gn/T/pip-ephem-wheel-cache-tmw2c1jg/wheels/a4/cb/1a/277a076c4434fadc0707a37ba48587dc2ac6397d517c3b9de7 Successfully built pyyaml cffi Failed to build cryptography ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects Exception information: Traceback (most recent call last): File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper status = run_func(*args) File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper return func(self, options, args) File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 375, in run raise InstallationError( pip._internal.exceptions.InstallationError: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects Removed build tracker: '/private/var/folders/38/kszkvfx157q2qy4fm0gwzxpw0000gn/T/pip-req-tracker-015zhyq5'

cli.azure.cli.core.extension.operations: Command '['/Users/daaronch/.pyenv/versions/3.8.12/bin/python', '-m', 'pip', 'install', '--target', '/Users/daaronch/.azure/cliextensions/azure-cli-ml', '/var/folders/38/kszkvfx157q2qy4fm0gwzxpw0000gn/T/tmpk4eld8ky/azure_cli_ml-1.37.0-py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1. cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at /Users/daaronch/.azure/cliextensions/azure-cli-ml cli.azure.cli.core.util: Failed to delete '/Users/daaronch/.azure/cliextensions/azure-cli-ml': [Errno 2] No such file or directory: '/Users/daaronch/.azure/cliextensions/azure-cli-ml'. Retrying ... cli.azure.cli.core.util: Failed to delete '/Users/daaronch/.azure/cliextensions/azure-cli-ml': [Errno 2] No such file or directory: '/Users/daaronch/.azure/cliextensions/azure-cli-ml'. Retrying ... cli.azure.cli.core.util: Failed to delete '/Users/daaronch/.azure/cliextensions/azure-cli-ml': [Errno 2] No such file or directory: '/Users/daaronch/.azure/cliextensions/azure-cli-ml'. Retrying ... cli.azure.cli.core.util: Failed to delete '/Users/daaronch/.azure/cliextensions/azure-cli-ml': [Errno 2] No such file or directory: '/Users/daaronch/.azure/cliextensions/azure-cli-ml'. You may try to delete it manually. 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 "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 658, in execute raise ex File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 721, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 692, in _run_job result = cmd_copy(params) File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 328, in call return self.handler(*args, kwargs) File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/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 "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/site-packages/azure/cli/core/extension/operations.py", line 341, in add_extension extension_name = _add_whl_ext(cli_ctx=cmd_cli_ctx, source=source, ext_sha256=ext_sha256, File "/Users/daaronch/.pyenv/versions/3.8.12/lib/python3.8/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 1. Use --debug for more information.

cli.azure.cli.core.azclierror: An error occurred. Pip failed with status code 1. Use --debug for more information. az_command_data_logger: An error occurred. Pip failed with status code 1. Use --debug for more information. cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x105734700>] az_command_data_logger: exit code: 1 cli.main: Command ran in 32.371 seconds (init: 0.060, invoke: 32.311) telemetry.save: Save telemetry record of length 3235 in cache telemetry.check: Negative: The /Users/daaronch/.azure/telemetry.txt was modified at 2022-04-19 21:11:25.910245, which in less than 600.000000 s

lostmygithubaccount commented 2 years ago

@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.

lostmygithubaccount commented 2 years ago

@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.

j0rd1smit commented 2 years ago

Yes, it works for me. Thank you ❤️

pcluo commented 6 months ago

having this ssue again

E:>az extension add --name ml Default enabled including preview versions for extension installation now. Disabled in May 2024. Use '--allow-preview true' to enable it specifically if needed. Use '--allow-preview false' to install stable version only. An error occurred. Pip failed with status code 1. Use --debug for more information.

lostmygithubaccount commented 6 months ago

I'd recommend opening a new issue @pcluo, not sure if anyone's checking closed issues this old

bernardogza83 commented 1 month ago

I am having this exact same issue

natke commented 1 month ago

Same issue. Is there a workaround?

lostmygithubaccount commented 1 month ago

I will re-recommend opening a new issue :) I'm going to unsubscribe from this, you'll have a much better chance with a new issue I suspect