Python执行ImportError:No module named MySQLdb异常


解决方法:

对于Linux来说,有多重包管理系统和安装机制。如果使用的是包含某种包管理器的Linux,那么可以很轻松的安装Python MySQLdb库。
Linux Fedora, CentOS系统:yum install MySQL-python
 
Linux Ubuntu操作系统:apt-get install python-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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM