On 4 April 2011 04:31, Tim Valenta <[email protected]> wrote:
>> Are you loading mod_python into the same Apache?
>>
>> Have you done check as shown in:
>
> Not using mod_python, and the informational dump from a wsgi script
> give the system python:
>
>    sys.version = '2.6.4 (r264:75706, Dec  7 2009, 19:02:09) \n[GCC
> 4.4.1]'
>    sys.prefix = '/usr'

Then the value of '/home/tim/project/myenv' can't be pointing at the
correct prefix location of the virtual environment.

In command line Python executable from virtual environment do:

  import sys
  print sys.prefix

Use what that says.

If that is the value, or still doesn't work, then you likely have a
permissions issue where user that Apache runs as cannot read
directories/files in the virtual environment.

In other words, if Python can't fund a usable Python installation
where you point it, it will fall back to using that which it would
normally use rather than fail.

Graham


>> You can activate the virtualenv in the WSGI script itself
>
> I may do that, as I realized after getting into the WSGIPythonHome
> option and realized it is a global setting, not something I can use
> per Apache virtualhost.  My goal is to allow multiple projects hosted
> on the same Apache (via virtualhosts), but to maintain isolation in
> virtualenvs.
>
> On Apr 3, 2:11 am, Graham Dumpleton <[email protected]>
> wrote:
>> Are you loading mod_python into the same Apache?
>>
>> Have you done check as shown in:
>>
>> http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python...
>>
>> to see what mod_wsgi is picking up?
>>
>> Graham
>>
>> On 3 April 2011 18:27, Tim Valenta <[email protected]> wrote:
>>
>>
>>
>>
>>
>>
>>
>> > Hello,
>>
>> > I'm trying to leverage a python virtualenv to set up what happens to
>> > be a Django project.  To get things started, the virtualenv has just
>> > the basics: SVN checkout of Django trunk, pip, and the MySQLdb-python
>> > package.
>>
>> > It's my understanding that the use of the global WSGIPythonHome
>> > directive should allow me to specify the path into my virtualenv (it's
>> > sys.prefix value) and mod_wsgi would use that version of python
>> > (assuming it matches the major/minor version as it was compiled
>> > against).
>>
>> > I've been pouring over documentation to figure out what I might be
>> > missing, but use of the directive doesn't seem to have much effect;
>> > Apache comes up with a 500 error where the log states that it cannot
>> > find the "django" module.  If I hack my project's .wsgi file to append
>> > django to the path, then the Apache error log reports that MySQLdb
>> > cannot be found.
>>
>> > Both modules import without problem when I use my virtualenv python,
>> > and of course both fail when I use the system default python.
>>
>> > Thinking to explore the problem further, I tried specifying in
>> > addition the WSGIPythonPath directive, to point mod_wsgi at the
>> > virtualenv's site-packages, but the situation is unchanged.
>>
>> > I'm wondering if there is any extra trouble I'm going through by using
>> > a VirtualHost?  Here is the extracted bit from my virtualhost
>> > configuration, which is included via sites-enabled:
>>
>> >    WSGIPythonHome /home/tim/project/myenv
>> >    <VirtualHost *:80>
>> >        WSGIScriptAlias / /home/tim/project/project.wsgi
>> >        ...
>> >    </VirtualHost>
>>
>> > Any suggestions as to what I might be doing wrong to make mod_wsgi not
>> > actually make the leap to my virtualenv python?  Or maybe I'm making
>> > assumptions about what this directive can do...
>>
>> > Thanks in advance.
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "modwsgi" 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 
>> > athttp://groups.google.com/group/modwsgi?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" 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/modwsgi?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" 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/modwsgi?hl=en.

Reply via email to