missing or incompatible version of the GNU C++ Standard Library (libstdc++.so.6), specifically the version GLIBCXX_3.4.30

Val Vorisek 0 Reputation points
2024-09-09T18:37:24.1033333+00:00

Command job script converted from notebook fails.
Exercise: Run a training script as a command job in Azure Machine Learning
URL: https://microsoftlearning.github.io/mslearn-azure-ml/Instructions/08-Script-command-job.html

Failing step: Convert a notebook to a script step 8 (Select the ▷▷ icon at the top of the notebook to save and run the script in the terminal.)

Traceback (most recent call last):

File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/ci2fc8e03614f4483cb3/code/Users/val/azure-ml-labs/Labs/08/src/train-classification-model.py", line 36, in <module>

from sklearn.model_selection import train_test_split
  File "/anaconda/envs/azureml_py38/lib/python3.9/site-packages/sklearn/__init__.py", line 82, in <module>

from .base import clone


from .utils import _IS_32BIT


from scipy.sparse import issparse


from . import fft


from ._helper import next_fast_len


from ._pocketfft import helper as _helper


from .basic import *


from . import pypocketfft as pfft



> ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /anaconda/envs/azureml_py38/lib/python3.9/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-39-x86_64-linux-gnu.so)




This question is related to the following [Learning Module](https://video2.skills-academy.com/en-us/training/modules/run-training-script-command-job-azure-machine-learning/7-summary)
Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,508 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SiddeshTN 3,780 Reputation points Microsoft Vendor
    2024-09-11T13:40:12.2633333+00:00

    Hi

    Thank you for submitting your query on the Microsoft Q&A Platform.

    Issue is likely caused by an incompatible system library (GLIBCXX_3.4.30), which is required by the scipy package in your Azure Machine Learning environment.

    Here are some troubleshooting steps that may help resolve the issue:

    1.First, make sure that the Azure Machine Learning compute instance is using the correct and updated environment. To do this, go to the Azure Machine Learning Studio, open the Compute page, and check which Python environment is being used. If needed, you can update the environment by running the following commands in the terminal:

    pip install --upgrade scikit-learn scipy
    
    

    2.Error suggests that the GLIBCXX library version is obsolete. While upgrading the system libraries directly on the compute instance is not straightforward, you can try to:

    Create a custom environment YAML file for your Azure ML job with the latest versions of necessary packages, ensuring compatibility with the compute environment.

    Install the updated version of scipy, scikit-learn, and other libraries in this environment.

    3.If the direct upgrade of scikit-learn and scipy does not resolve the issue, you can create a custom environment in Azure Machine Learning. To do this, define an environment.yml file with the necessary dependencies, such as:

    name: custom-aml-environment
    dependencies:
      - python=3.8
      - scikit-learn
      - scipy
      - pip
      - pip:
          - azureml-core
          - azureml-dataprep
          - azureml-train
    
    

    4.After updating the libraries, rerun the script as a command job:
    Open the Labs/08/Run script as command job.ipynb notebook and run all the cells.
    Navigate to the Jobs page in Azure ML studio and monitor the job's progress.

    5.After completing the exercise, remember to delete the resource group to avoid unnecessary charges by following the steps outlined in the original exercise instructions.

    If updating the libraries and environment resolves the issue, you should be able to run your script without encountering the GLIBCXX error.

    If the issue persists, please feel free to contact us for further assistance and attach a screenshot of the error for reference.

    If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.

    Thank you.

    0 comments No comments

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.