Aha, that is helpful. I think I've partially solved this now.

If I run 'import django' at the command line, then it seems to import fine; 
there is no error message, and 'print sys.modules' now lists it.

So I tried specifying the site-packages path at the top of my script and it 
removed the ImportError. That makes it seem like my web-server's pythong is 
running with different pythonpath settings than my command-line's python. I 
think I can probably unravel the mystery from there. 

I'm actually attempting to run this all in Google App Engine. Just to keep 
things as complicated as possible. So the lines generating the error were
~~
from google.appengine.dist import use_library
use_library('django','1.1')
~~

=T=




On Mar 3, 2010, at 4:20 PM, Shawn Milochik wrote:

> Printing sys.modules won't show django unless you've imported Django.
> 
> What are you trying to do, anyway? You don't normally import Django in a 
> Python script. You usually start a Django project by using django-admin.py 
> and letting it create a manage.py which uses the proper Python.
> 
> Search your system for django-admin.py and see where it lies. Try executing 
> it in a few different ways:
> 
> python django-admin.py startproject fake_project_name
> django-admin.py startproject fake_project_name
> /explicit/path/to/some/python/installation/python django-admin.py 
> startproject fake_project_name
> 
> Let us know what you get.
> 
> Shawn
> 
> 
> On Mar 3, 2010, at 7:12 PM, Tim Jones wrote:
> 
>> Thanks for the reply.
>> 
>> "which python" returns: /opt/local/bin/python
>> 
>> "python -V" returns: Python 2.5.5
>> 
>> I know I've got the OSX default Pythons installed as well, but I've done my 
>> best to avoid running those.
>> 
>> Like I said in my first email, printing sys.path in the python prompt 
>> returns a big list of directories, including  
>> "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages",
>>  which contains the django installation.
>> 
>> But when I run "print sys.modules", Django is not included. It doesnt make 
>> sense to me that Django isn't included in sys.modules even though it's 
>> installed in a dir listed by sys.path.
>> 
>> I'm a noob to both Python and Django so apologies if I'm missing something 
>> obvious.
>> 
>> =T=
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to