views:

280

answers:

1

Hi!

I'm uploading my first Django app to my Dreamhost server. My app uses xlwt package and since I can't install it in the default location ( /usr/lib/python2.3/site-packages/xlwt ), I installed it on another location by:

python setup.py install --home=$HOME

Then xlwt is installed here:

/home/myuser/lib/python/xlwt/

After that, I add this folder to de env var PYTHONPATH

export PYTHONPATH=$PYTHONPATH:/home/myuser/lib/python

... And in a python promt I can do this (without problems)

import xlwt

... But if I do the same thing in my app code, I have the follow error:

Could not import ISI.restaurante.views. Error was: No module named xlwt

[where ISI.restaurante.views is my code where I do the import]

Could u help me? Thanks!

+4  A: 

PYTHONPATH may only be set when you run from the shell, you can set path programatically from python using

import sys
sys.path.append('/home/myuser/lib/python')
cobbal
omg, noob error!A lot of THAAAAAANKS! :DNow, it's working!