Apologies, I'm a rubyist and this is a beginner question but I'm not finding a 
great answer with lots of googling. I am writing a library, organized something 
like this:

awesome_lib/awesome.py
awesome_lib/util/__init__.py
awesome_lib/util/helper.py

In the top of awesome.py:

foo = 'bar'
import helper

In the top of helper.py:

import awesome
print awesome.foo

IRL, I'm doing this for things like referring to the main logger from within 
the utility method.

This works great when running tests through nose. In a test file I 'import 
awesome', refer to awesome.helper and everything is fine.

If I try to put this library into a project, however, the import fails:

~/foo.py
~/awesome_lib

'python foo.py' (only code is 'from awesome_lib import awesome')
 ImportError: No module named awesome

The error occurs when importing the helper and it tries to 'import awesome' and 
fails.

I'm sure I am doing something stupid, can someone point me in the right 
direction?
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to