Ubuntu下 fatal error: Python.h: No such file or directory 解决方法

 

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

本人用以上两个命令还是没有生效,还是没有那个头文件

没办法了,卸载python3.5,重新安装,有风险,最好不要走此步

1.卸载python3.5 : sudo apt-get remove python3.5

 卸载python3.5以及它的依赖包: sudo apt-get remove --auto-remove python3.5

2.安装python3.5

sudo apt-get install python3.5

 

二:重启系统发现桌面上只有个一个鼠标,其他什么都没有了,猜可能和卸载python3.5有关

ctrl +alt+f1 进入终端

sudo apt-get install ubuntu-desktop

如果出现提示dpkg出现问题,需要运行:sudo dpkg --configure -a 进行修复,修复完继续执行上一条安装命令

reboot

 

 

你可能感兴趣的:(python3)