ImportError raised in script, not interactive session.

Adam Blinkinsop hackerblinks at gmail.com
Mon Jul 31 19:44:08 EDT 2006


Jordan R McCoy wrote:
> If this isn't the case, what are you using for TARGET_DIR?

${TARGET_DIR} = /home/blinks/projects/overwatch/target/lib/python
I've started the interactive session from several different
directories, and never had a problem.

My make output (note the second item in sys.path):
--
cd /home/blinks/projects/overwatch/target/bin &&
PYTHONPATH="/home/blinks/projects/overwatch/target/lib/python"
./test.py
 *** sys.path: ['/home/blinks/projects/overwatch/target/bin',
'/home/blinks/projects/overwatch/target/lib/python',
'/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload', '/usr/lib/portage/pym',
'/usr/lib64/python2.4/site-packages',
'/usr/lib/python2.4/site-packages']
Traceback (most recent call last):
  File "./test.py", line 6, in ?
    from overwatch.view import console
ImportError: No module named view
make: *** [test] Error 1
--

Oh, and:
--
$ ls /home/blinks/projects/overwatch/target/lib/python/
overwatch
--

Thanks for the help!  If you want a copy of the project to reproduce,
it's on Subversion at http://tools.assembla.com/svn/Overwatch/trunk
(should be readable).




More information about the Python-list mailing list