我收到此错误:
Traceback (most recent call last):
File "test.py", line 1, in <module>
import movies
File "/home/xyz/topmovies/sample.py", line 3, in <module>
import config
File "/home/xyz/topmovies/config.py", line 1, in <module>
import MySQLdb
ImportError: No module named MySQLdb
我通过使用pip,easy等不同的命令成功安装了mysqldb模块,我尝试了所有这些命令,
sudo pip install MYSQL-python
sudo apt-get build-dep python-mysqldb
sudo apt-get install python-pip python-dev libmysqlclient-dev
pip3 install http://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.zip.
但我一次又一次地收到这个错误。请帮帮我。
答案 0 :(得分:0)
使用:
python3 -m pip install mysql-python
OR
python3 -m pip install mysqlclient