尝试安装psutils
造成了很大的麻烦...
$ python -V
Python 2.4.2
$ cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 4
$ cd psutil-2.1.1/
$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 17, in ?
from distutils.core import setup, Extension
ImportError: No module named distutils.core
接下来-我尝试安装
setuptools
以使用easy_install
:$ which easy_install
which: no easy_install
$ cd ../setuptools-1.4/
$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 12, in ?
from distutils.util import convert_path
ImportError: No module named distutils.util
尝试从
distutils
安装ez_setup.py
:$ python ez_setup.py
Traceback (most recent call last):
File "ez_setup.py", line 278, in ?
main(sys.argv[1:])
File "ez_setup.py", line 210, in main
egg = download_setuptools(version, delay=0)
File "ez_setup.py", line 139, in download_setuptools
from distutils import log
ImportError: No module named distutils
所以-我该如何安装呢?
P.S.不,我还没有在这台机器上 Root ,也无法使用包管理器。
最佳答案
您需要运行此命令(如果python3发生错误)==> sudo apt-get install python3-distutils --reinstall
您需要运行此命令(如果python2发生错误)==> sudo apt-get install python2-distutils --reinstall
关于python - ImportError : No module named distutils,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23626034/