From the command line, I can import MySQLdb just fine, but when I try to run the same code in eclipse using the PyDev plugin, I get:
<code>
ImportError: No module named MySQLdb
</code>
Simple example code that doesn't work is:
<code>
if name == 'main':
import MySQLdb
</code>
I found someone suggesting adding it to the forced builtins, but I don't know what to add or it either doesn't work or doesn't work on Mac. Has anyone seen and fixed this problem or have any other ideas? Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2009-09-06
The forum blew the tab before "import MySQLdb" in that example. It is correctly tabbed when I run it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
From the command line, I can import MySQLdb just fine, but when I try to run the same code in eclipse using the PyDev plugin, I get:
<code>
ImportError: No module named MySQLdb
</code>
Simple example code that doesn't work is:
<code>
if name == 'main':
import MySQLdb
</code>
I found someone suggesting adding it to the forced builtins, but I don't know what to add or it either doesn't work or doesn't work on Mac. Has anyone seen and fixed this problem or have any other ideas? Thanks!
The forum blew the tab before "import MySQLdb" in that example. It is correctly tabbed when I run it.
Sounds like you have an include path problem in PyDev. Run "print sys.path" from both environments and look for differences.