On Feb 5, 4:13 pm, "larry.mart...@gmail.com" <larry.mart...@gmail.com>
wrote:
> On Feb 5, 4:05 pm, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote:
>
>
>
>
>
>
>
> > On Sun, 5 Feb 2012 14:08:52 -0800 (PST), "larry.mart...@gmail.com"
>
> > <larry.mart...@gmail.com> wrote:
>
> > >It's exactly the same sys.path I get from command line python, where
> > >the import works.
>
> >         NO IT ISN'T!
>
> > >['/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg', '/
> >         <snip>
> > >['', '/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg',
>
> >         Note the difference? The latter includes "current working directory"
> > as the first entry.
>
> Ok, I didn't notice that. However wouldn't the cwd be '.' and not an
> empty sting? In any case, when I try the import from command line
> python, I am not in the dir containing django.core.handlers.wsgi.
>
> -larry

> On Feb 5, 4:32 pm, Graham Dumpleton <graham.dumple...@gmail.com>
> wrote:

> > At the start of the WSGI script file, add:

> >   import django
> >   print django.__file__

> > In other words, work out whether top level 'django' can be installed
> > and if so where it is coming from.

> > You might inadvertently have a django.py file sitting somewhere which
> > it is finding by mistake.

> When I add that I get:

> [Mon Feb 06 06:36:57 2012] [error] [client 127.0.0.1]     import
> django
> [Mon Feb 06 06:36:57 2012] [error] [client 127.0.0.1] ImportError: No
> module named django

> When I do the same from command like python I get:

> $ python
> Python 2.6.6 (r266:84292, Dec  7 2011, 20:38:36)
> [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>> 
> import django
> >>> print django.__file__

> /usr/lib/python2.6/site-packages/django/__init__.py

> When I print sys.path from my wsgi script /usr/lib/python2.6/site-
> packages is there. Does /usr/lib/python2.6/site-packages/django need
> to be given somewhere?


I re-installed django and that seems to have fixed the problem. Not
sure why it did - I installed it the same way as I did before, but
whatever, it works now.

-larry

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

Reply via email to