ML Studio Data Labeling On-Demand ML Assisted Labeling failing with ImportError

Steve Mandras 81 Reputation points
2025-12-01T22:30:26.2733333+00:00

We are trying to kick off an on-demand ML assissted labeling against a ML Studio Data Labeling project. Getting the following error (using AzureML-ai-ml-automl-dnn-text-gpu:27, auto-selected by ML Studio). I see there is a version 36 that may fix this issue. How can we use the latest environment for our ML assisted labeling needs? I believe this is a package version mismatch that may be fixed in newer versions.

Error (std_log.txt):

WARNING:root:user_name does not exist.
Cleaning up all outstanding Run operations, waiting 300.0 seconds
1 items cleaning up...
Cleanup took 0.06811404228210449 seconds
Traceback (most recent call last):
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1968, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/transformers/training_args.py", line 76, in <module>
    from accelerate.state import AcceleratorState, PartialState
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/__init__.py", line 16, in <module>
    from .accelerator import Accelerator
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/accelerator.py", line 36, in <module>
    from .checkpointing import load_accelerator_state, load_custom_state, save_accelerator_state, save_custom_state
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/checkpointing.py", line 24, in <module>
    from .utils import (
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/utils/__init__.py", line 193, in <module>
    from .bnb import has_4bit_bnb_layers, load_and_quantize_model
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/utils/bnb.py", line 29, in <module>
    from ..big_modeling import dispatch_model, init_empty_weights
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/big_modeling.py", line 24, in <module>
    from .hooks import (
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/hooks.py", line 31, in <module>
    from .utils.other import recursive_getattr
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/utils/other.py", line 29, in <module>
    from ..commands.config.default import write_basic_config  # noqa: F401
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/commands/config/__init__.py", line 19, in <module>
    from .config import config_command_parser
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/commands/config/config.py", line 25, in <module>
    from .sagemaker import get_sagemaker_input
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/accelerate/commands/config/sagemaker.py", line 35, in <module>
    import boto3  # noqa: F401
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/boto3/__init__.py", line 16, in <module>
    from boto3.session import Session
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/boto3/session.py", line 17, in <module>
    import botocore.session
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/botocore/session.py", line 29, in <module>
    import botocore.credentials
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/botocore/credentials.py", line 34, in <module>
    from botocore.config import Config
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/botocore/config.py", line 16, in <module>
    from botocore.endpoint import DEFAULT_TIMEOUT, MAX_POOL_CONNECTIONS
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/botocore/endpoint.py", line 22, in <module>
    from botocore.awsrequest import create_request_object
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/botocore/awsrequest.py", line 24, in <module>
    import botocore.utils
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/botocore/utils.py", line 32, in <module>
    import botocore.httpsession
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/botocore/httpsession.py", line 10, in <module>
    from urllib3.util.ssl_ import (
ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/urllib3/util/ssl_.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "hd_text_classification_dnn_driver.py", line 1, in <module>
    from azureml.automl.dnn.nlp.classification.multiclass import runner
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/azureml/automl/dnn/nlp/__init__.py", line 12, in <module>
    from azureml.automl.dnn.nlp.common._utils import _load_pyfunc  # noqa: F401
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/azureml/automl/dnn/nlp/common/_utils.py", line 37, in <module>
    from transformers import TrainingArguments
  File "<frozen importlib._bootstrap>", line 1055, in _handle_fromlist
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1956, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/transformers/utils/import_utils.py", line 1970, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.training_args because of the following error (look up to see its traceback):
cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (/azureml-envs/azureml-automl-dnn-text-gpu/lib/python3.9/site-packages/urllib3/util/ssl_.py)


Azure Machine Learning
{count} vote

Answer accepted by question author
  1. SRILAKSHMI C 11,215 Reputation points Microsoft External Staff Moderator
    2025-12-02T10:33:57.3866667+00:00

    Hi Steve Mandras,

    Welcome to Microsoft Q&A and Thank you for reaching out.

    I understand that you’re running into an ImportError when starting an on-demand ML Assisted Labeling job in Azure ML Studio, and the logs indicate a package/version mismatch inside the auto-selected environment (azureml-automl-dnn-text-gpu:27). The issue is related to outdated dependencies in that environment, and newer versions (such as v36) include updates that resolve the urllib3 / DEFAULT_CIPHERS import failure.

    At the moment, the built-in environment used by ML Assisted Labeling is pinned to older versions and cannot automatically pick up newer images unless manually overridden. To address this, here are the available options:

    Use the Updated Environment (v36)

    If version 36 is available in your workspace, switching the ML Assisted Labeling job to this environment resolves the import issue. The ImportError is caused by outdated urllib3 and botocore packages, which v36 fixes.

    If you are manually configuring environments, ensure that the newer environment is installed:

    pip install azureml-ai-ml-automl-dnn-text-gpu==36
    

    Once installed, verify its packages:

    pip show azureml-ai-ml-automl-dnn-text-gpu
    

    Confirm Dependency Compatibility

    The error clearly shows that the older environment attempts to load modules (transformers, accelerate, botocore) that depend on newer SSL/urllib3 components. Updating the environment ensures all dependent libraries load correctly.

    Trigger a Test Run

    After switching to the updated environment, run a small test labeling job to confirm the import modules load without errors and everything resolves cleanly.

    Please refer this

    I Hope this helps. Do let me know if you have any further queries.

    Thank you!

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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