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