Finding modules when running python with virtualenvs, in launchd -


this q&a similar 1 offered in python script not running in crontab calling pysaunter , put in terms of launchd & plists.

i running python scripts in virtualenv, when tried schedule in launchd, received traceback error plist error log file saying "importerror: no module named sqlalchemy". do, do?

at first tried adding .virtualenv sitepackages absolute path path , python path variables in .bash_profile, , .profile. tried setting environment variables path , pythonpath in launchd config. no joy.

what fixed add plist environment variables path , pythonpath. fixed it? not sure, having them both doesn't hurt anything. in these environment variables, included absolute path sitepackages in .virtualenvs. problem solved.

hth.

example:

<key>environmentvariables</key>     <dict>     <key>path</key><string>/users/user/.virtualenvs/oraenv/lib/python2.7/site-packages/</string>     <key>pythonpath</key><string>/users/user/.virtualenvs/oraenv/lib/python2.7/site-package/</string>     </dict> 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -