在尝试导入 mysql 时,我在 Python 中遇到了问题。我的代码的开头是(我正在使用 monkeyrunner 运行脚本):
#!/usr/bin/env python
import sys
import MySQLdb
.
.
.
etc
每次我尝试运行代码时,都会收到当前错误:
dani@debian:~/public/Yandex Maps Test$ monkeyrunner test.py
130413 00:49:22.066:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
130413 00:49:22.066:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most recent call last):
File "/home/dani/public/Yandex Maps Test/test.py", line 4, in <module>
import MySQLdb
ImportError: No module named MySQLdb
130413 00:49:22.066:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at org.python.core.PyException.fillInStackTrace(PyException.java:70)
.
.
.
etc
我试图为python重新安装mysql:
sudo apt-get reinstall python-mysqldb mysql-server
但没有任何帮助。有什么想法或提示吗?
问候,,,