Last Updated on 2021-10-23 by Clay
ModuleNotFoundError: No module named 'distutils.util'
The error message we always encountered at the time we use pip
tool to install the python package, or use PyCharm to initialize the python project. No matter which situation it is, we need to install pip or distutils, or ever both.
You can use the following command to confirm the pip
tool (My environment is return Python3.6.8; If you never change the configuration, the default settings is pip->python2 and pip3->python3).
pip3 -v
Output:
Command 'pip3' not found, but be installed with:
sudo apt install python3-pip
Solution
Use the following command to install pip
.
# Python 2.x
sudo apt install python-pip
# Python 3.x
sudo apt install python3-pip
If the problem is still exist, you need to try to install the python distutils.
sudo apt install python3-distutils
References
- https://www.cnblogs.com/phpper/p/10887602.html
- https://askubuntu.com/questions/1239829/modulenotfounderror-no-module-named-distutils-util
- https://itectec.com/ubuntu/ubuntu-modulenotfounderror-no-module-named-distutils-util/