Forums

Environment variables for scheduled tasks

I have set up environment variables in ./bashrc. When I do echo $PYTHONPATH in a bash or in a scheduled task I get the right value.

However if I go in a bash and type python / import os / print os.environ['PYTHONPATH'] then the variable is not defined.

It has been 2 days that I am trying to understand this with no success...

I guess the two types of variables live in different spaces but I have no clue on how to fix this.

I will appreciate any help.

Thank you very much in advance.

Found the explanation in another post. export PYTHONPATH="xxx"; python scheduled_task.py will do the trick. Sorry for the false alarm. Thank you

Great -- glad you worked it out!