Rate This Document
Findability
Accuracy
Completeness
Readability

Error Reported for Running the Yum Command After Python3 Is Installed

Symptom

After Python3 is installed, the message "ModuleNotFoundError: No module named 'dnf'" is displayed when you use Yum.

Key Process and Cause Analysis

openEuler has built-in Python 3.7, which uses the Yum from the dnf soft link and is closely related to libpython3.7m.so.1.0.

Conclusion and Solution

  1. Open the /usr/bin/yum file.
    vi /usr/bin/yum
  2. Press i to enter the edit mode. Change #!/usr/bin/python3 at the beginning to #!/usr/bin/python3.7m.

  3. Press Esc, type :wq!, and press Enter to save the settings and exit.