launchd not finding user created python modules

Hello, I'm trying to get launchd to run a program of mine every hour with a pretty vanilla plist created using Lingon. Launchd is able to start my python program but it runs into issues when it tries loading user created modules. Here is the form of the errors that appear in console when my script starts loading (changed the names since they don't matter).

File "/home/strohm/python.lib/myscript.py", line 7 in <module>
import mymodule
ImportError: No module named mymodule

My python script begins like:
#! /sw/bin/python
#
#
#

import time
from mymodule import *
import sys
...

It is trying to run my program, so that's at least a step in the right direction. I have my .cshrc file setup so that it knows where these modules are kept and I can thus run my program just fine through the terminal where my default shell is tcsh. Thus it seems that launchd isn't getting any of my setup information from my .cshrc file so how can I get it to know where these are located? It seems to work just fine loading in python default modules, but just not user created ones.

Here is my file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.astroh.work.myscript</string>
<key>ProgramArguments</key>
<array>
<string>/home/strohm/python.lib/myscript.py</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>


Thanks in advance for the help!

Posted on Oct 30, 2009 8:42 AM

Reply

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

launchd not finding user created python modules

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.