Unexpected error Exception cannot import name 'find_stack_level' from 'pandas.util._exceptions'

srinivas kalapatapu 0 Reputation points

Hi Team,

We are using Microsoft curated images for deploying trained model in Azure container registry ACI . Currently in all our dev or stage or dev/qa/prod environment we are getting the below error. we are mcr curated images with py 3.8 and latest for py3.9.

any help greatly appreciated.

We followed below steps to trouble shoot the issue: but still issue persist

  1. Check the Pandas Version: Ensure that the version of pandas you're using is compatible with your current environment. You can check the pandas version by using print(pandas.version).
  2. Update the Pandas Version: If the pandas version is outdated, you might need to upgrade it. Use the command !pip install --upgrade pandas to upgrade pandas to the latest version.
  3. Reinstall Pandas: If the issue persists, try reinstalling pandas. Uninstall it first using !pip uninstall pandas and then reinstall it using !pip install pandas.
  4. Check Dependencies: Make sure all the dependencies required by pandas are correctly installed and updated.
  5. Create a New Environment: If the issue still persists, you might want to create a new environment and install pandas there. This will ensure a clean environment with minimal interference from other packages.

User's image

"STATUS": "Unexpected error: cannot import name 'find_stack_level' from 'pandas.util._exceptions' (/azureml-envs/data-labeling/lib/python3.9/site-packages/pandas/util/_exceptions.py)"

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,657 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,366 Reputation points Microsoft Employee

    @srinivas kalapatapu Have you moved to data-labeling image from lightgbm as per your screenshot? I was just checking the difference in Pandas versions between these two images from ML studio environments page, basically, the conda dependencies yaml. I noticed that the data-labeling image does not specify any version dependency whereas lightgbm image has a dependency of pandas to


    You can view the complete dependency list from the ML studio environments page and then change your deployment environment to add all the required dependencies.

    User's image

    User's image

    As you can see, azureml-dataset-runtime is installing a higher version in your latest image and might be causing it to break. Thanks!!

    0 comments No comments