[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uwsgi
Subject:    [uWSGI] PEP-370 (per user site-packages directory) support?
From:       gdamjan () gmail ! com (Damjan Georgievski)
Date:       2010-05-20 12:37:04
Message-ID: AANLkTinH1HZYk4GnglCl8L79SZP61F27qXXkgHWidlCw () mail ! gmail ! com
[Download RAW message or body]

>> This is supported in Python 2.6 and newer. Works similar to virtualenv
>> but much cleaner and without any other tools.
>> If you want to see how it works, just download some simple Python
>> package (let's say Jinja2) and install it with:
>>
>> ?export PYTHONUSERBASE=$HOME/my-py
>> ?python setup.py install --user
>>
>> The package will get installed in:
>> ?$PYTHONUSERBASE/lib/python2.6/site-packages/jinja2/
>> and there will be no polution with other files.
>> As long as PYTHONUSERBASE is defined, python will be able to find the
>> package there.
>>
>> Python puts the $PYTHONUSERBASE/lib/python2.6/site-packages directory
>> just before the system-wide /usr/lib/python2.6/site-packages so
>> there's no need for symlinks and other hacks.
>>
>> Now the question is how to use a environment created like that with uwsgi?
>>
>>
>>
>> http://docs.python.org/whatsnew/2.6.html#pep-370-per-user-site-packages-directory
>>
>
>
> Simply:
>
> PYTHONUSERBASE=$HOME/my-py ./uwsgi -s :3031 ....
>
>
> Or you can create a shell script:
>
> #!/bin/sh
>
> export PYTHONUSERBASE=$HOME/my-py
> export UWSGI_SOCKET=:3031
> export UWSGI_MODULE=my_app
> ./uwsgi

True, this works - it should've been obvious :)

-- 
damjan

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic