python in cron job cannot find global environment setting for PYTHONPATH
Issue
- As a user, put the below in .bash_profile, but it doesn't recognized in a cron job
export PYTHONPATH=/usr/local/python-2.7/lib/python2.7/site-packages
- When the python script called directly, it does work properly
- Created a file under /etc/profile.d with the below detail, but also cron job doesn't use it
export PYTHONPATH=/usr/local/python-2.7/lib/python2.7/site-packages
Environment
- Red Hat Enterprise Linux
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.