Unable to install azureml-sdk on Mac 2021 Silicon

Furqan Hashim 25 Reputation points
2024-10-10T17:48:46.7433333+00:00

I am using a M1 mac running on MacOS Sonoma 14.7. I have project dependencies that I need to install to execute the project. I am using Python version 3.9. When I install the same dependencies on Windows machine it works fine. If fails on a Mac. While running pip install azureml-sdk I get error mentioned below.

Collecting azureml-dataprep<5.2.0a,>=5.1.0a (from azureml-dataset-runtime~=1.57.0->azureml-dataset-runtime[fuse]~=1.57.0->azureml-sdk)

  Using cached azureml_dataprep-5.1.5-py3-none-any.whl.metadata (2.2 kB)

  Using cached azureml_dataprep-5.1.4-py3-none-any.whl.metadata (2.1 kB)

  Using cached azureml_dataprep-5.1.3-py3-none-any.whl.metadata (2.1 kB)

  Using cached azureml_dataprep-5.1.2-py3-none-any.whl.metadata (2.1 kB)

  Using cached azureml_dataprep-5.1.1-py3-none-any.whl.metadata (2.1 kB)

  Using cached azureml_dataprep-5.1.0-py3-none-any.whl.metadata (2.1 kB)

ERROR: Cannot install azureml-dataset-runtime because these package versions have conflicting dependencies.

The conflict is caused by:

    azureml-dataprep 5.1.6 depends on azureml-dataprep-native<42.0.0 and >=41.0.0

    azureml-dataprep 5.1.5 depends on azureml-dataprep-native<42.0.0 and >=41.0.0

    azureml-dataprep 5.1.4 depends on azureml-dataprep-native<42.0.0 and >=41.0.0

    azureml-dataprep 5.1.3 depends on azureml-dataprep-native<42.0.0 and >=41.0.0

    azureml-dataprep 5.1.2 depends on azureml-dataprep-native<42.0.0 and >=41.0.0

    azureml-dataprep 5.1.1 depends on azureml-dataprep-native<42.0.0 and >=41.0.0

    azureml-dataprep 5.1.0 depends on azureml-dataprep-native<42.0.0 and >=41.0.0

To fix this you could try to:

1. loosen the range of package versions you've specified

2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,340 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 33,866 Reputation points Volunteer Moderator
    2024-10-10T21:23:09.62+00:00

    The error you're encountering on your M1 Mac running macOS Sonoma is due to conflicting package dependencies when installing azureml-sdk, particularly around the azureml-dataprep-native package. This is a common issue, especially when working on Apple's M1 chip, as certain Python packages may not yet fully support this architecture or have binary dependencies that aren't compatible.

    Here are some potential solutions you can try:

    1. Use Rosetta 2

    Since some Python packages may not be optimized for ARM architecture, running the terminal using Rosetta 2 might help by emulating an Intel-based environment:

    • Enable Rosetta 2 for your terminal:
      • Right-click on the Terminal app in Finder.
      • Select Get Info.
      • Check the box that says Open using Rosetta.
      • Restart your terminal and try installing the package again.

    2. Use --no-deps Flag with pip

    You can try installing azureml-sdk without installing dependencies by using the --no-deps flag:

    
    pip install azureml-sdk --no-deps
    
    

    This may allow you to bypass the dependency conflict and then you can install the required dependencies manually.

    3. Manually Install Compatible Versions of Dependencies

    You can manually install compatible versions of the azureml-dataprep and azureml-dataprep-native packages before installing the azureml-sdk. Based on the error, you should target azureml-dataprep-native>=41.0.0, <42.0.0:

    
    pip install azureml-dataprep-native==41.0.0
    
    pip install azureml-dataprep==5.1.0
    
    pip install azureml-sdk
    
    

    4. Use a Virtual Environment with Intel Emulation

    Another approach is to create a new Python environment using an x86 architecture. You can do this using Miniforge, a Conda-based Python distribution that supports both ARM and Intel architectures.

    • Install Miniforge for Apple Silicon:
    • Create a new virtual environment with Intel support:
      
        conda create --name azureml-intel python=3.9
      
        conda activate azureml-intel
      
      
    • Install the azureml-sdk package:
      
        pip install azureml-sdk
      
      

    This will use an emulated environment for Intel-based packages, which may resolve the conflict.

    5. Use Docker

    As a last resort, you can use Docker to run your Azure ML projects. Docker containers can emulate different architectures, and Azure provides official Docker images that come pre-installed with the Azure ML SDK.

    • Install Docker for Mac (Apple Silicon)
    • Pull an Azure ML image:
      
        docker pull mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04:20230919.v1
      
      
    • Run the container:
      
        docker run -it mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04:20230919.v1 /bin/bash
      
      

    Inside the container, you can set up your project environment and run the Azure ML SDK without dealing with local architecture issues.

    Let me know if any of these methods work for you or if you need further assistance.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.