Pydev and Django: Shell not finding certain modules?

Posted by Rosarch on Stack Overflow See other posts from Stack Overflow or by Rosarch
Published on 2010-05-03T18:35:06Z Indexed on 2010/05/03 18:38 UTC
Read the original article Hit count: 398

Filed under:
|
|

I am developing a Django project with PyDev in Eclipse. For a while, PyDev's Django Shell worked great. Now, it doesn't:

>>> import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
C:\Python26\python.exe 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
>>> 
>>> from django.core import management;import mysite.settings as settings;management.setup_environ(settings)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named mysite.settings
>>> 

The dev server runs just fine. What could I be doing wrong?

The models module is also conspicuously absent:

>>> import mysite.myapp.models
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ImportError: No module named mysite.myapp.models

On the normal command line, outside of PyDev, the shell works fine.

Why could this be happening?

© Stack Overflow or respective owner

Related posts about django

Related posts about pydev