In article <5bc2641f-44fc-4324-b299-400ccbc79...@p8g2000yqb.googlegroups.com>, stopchuckingstuff <stopchuckingst...@me.com> wrote: [...] > This just gets even more confusing! > > I used a shebang line: > > #!/Library/Frameworks/Python.framework/Versions/2.6/bin/python > > which i got from which python in terminal, and now i get this error > when trying to import MySQLdb: > > <type 'exceptions.ImportError'>: No module named pkg_resources > > How!? I don't get that error when using that same version of python in > IDLE... > > What's going on?!
Sounds like setuptools is not being found on sys.path. And, judging from your earlier post, it appears that sys.path when running under Apache includes /Library/WebServer/.python-eggs. Perhaps you need to ensure setuptools is installed there. That wouldn't normally be on the python's sys.path when running from the terminal. But I realized after my last response that I should have asked how you were using Python with Apache: presumably with mod_wsgi or, possibly, mod_python. In either case, the configurations are more complex and something I have little experience with so I should probably point you elsewhere. For mod_wsgi, Graham Dumpleton offers exemplary thorough documentation here: http://code.google.com/p/modwsgi/ http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX http://code.google.com/p/modwsgi/wiki/WhereToGetHelp Good luck. -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/listinfo/python-list