红联Linux门户
Linux帮助

Python执行ImportError:No module named MySQLdb异常

发布时间:2017-03-17 09:42:48来源:linux网站作者:Agoly
错误:ImportError:No module named MySQLdb
Python执行ImportError:No module named MySQLdb异常
 
解决方法:
对于Linux来说,有多重包管理系统和安装机制。如果使用的是包含某种包管理器的Linux,那么可以很轻松的安装Python MySQLdb库。
Linux Fedora, CentOS系统:yum install MySQL-python
Linux Ubuntu操作系统:apt-get install python-mysqldb
Python执行ImportError:No module named MySQLdb异常
 
sudo pip install
The directory '/home/hancool/.cache/pip' or its parent directory is not owned by the current user and the cache has been disabled.
Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
解决方法:
直接 pip install django,不用sudo,权限的问题,对后续使用不影响。不管是用pip装什么模块,前面都尽量不要加sudo
 
本文永久更新地址:http://www.linuxdiyf.com/linux/29241.html