"No module named '_sqlite3'" Is Displayed When a Pangu Model Training Job Is Executed

Symptom

When a pangu model training job is executed, "No module named '_sqlite3'" is displayed.

Cause Analysis

The sqlite3 dependency required by the Pangu Image is missing. As a result, the training fails.

Solution

  1. Run the corresponding installation command based on the current OS type to install the sqlite3 dependency.
    • Ubuntu
      sudo apt-get install libsqlite3-dev
    • CentOS
      sudo yum install sqlite-devel
  2. Run the following command to recompile Python (Python 3.7.5 is used as an example).
    1. Download the Python package.
      wget https://repo.huaweicloud.com/python/3.7.5/Python-3.7.5.tar.xz
    2. Decompress the package.
      tar -xf Python-3.7.5.tar.xz && cd Python-3.7.5 && ./configure --prefix=/usr/local/python3.7.5 --enable-shared
    3. Perform the installation.
       make && make install