[Twisted-Python] Failed to load application.
Hi I'm getting a problem with "Failed to load application: No module named system" I have a test.tac and a system.py inside a user (joe) home directory. I can start it as Joe: [joe@bubbles joe]$ twistd -y test.tac However, when I try to start it as root in joe's home dir, I get the "Failed to load application" error message. [root@bubbles joe]# twist -y test.tac Failed to load application: No module named system I solved it via adding Joe's home dir (/home/joe) to the pythonpath in root's acct. Why can't it import the system module even though it's in the same dir? A python prompt does work when I manually import the module. Liming
On Sat, 2004-07-31 at 01:28, Tsai Li Ming wrote:
I solved it via adding Joe's home dir (/home/joe) to the pythonpath in root's acct. Why can't it import the system module even though it's in the same dir? A python prompt does work when I manually import the module.
Python adds the directory where the *file you are running* is to PYTHONPATH. So, in this case it'll add whatever directory twistd is in, *not* the current directory. To be nice, twistd, trial etc. add "." to the PYTHONPATH as well, so it behaves the way people want, but this is disabled when running as root for security reasons. -- Itamar Shtull-Trauring http://itamarst.org
participants (2)
-
Itamar Shtull-Trauring
-
Tsai Li Ming