我错误地从kali linux卸载了python 2.7,每当我运行python时,我都会收到以下错误。有解决此问题的方法
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 563, in <module>
main()
File "/usr/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 278, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 253, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 243, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 521, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 420, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 288, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/lib/python2.7/config/Makefile (No such file or directory)
有人可以帮忙吗?
答案 0 :(得分:2)
运行:
sudo apt-get install python-2.7
您可能必须重新安装从pip安装的所有其他软件包
答案 1 :(得分:0)
您需要安装python-apt
模块
sudo python2.7 -m pip install python-apt