ImportError with packages

M

mr19

I'm running into import problems trying to create a
package that is similiar in layout to the one in the
docs described here:

http://www.boost.org/libs/python/do...thon/techniques.html#python.creating_packages

So my package layout is as follows:

xyzzy/
__init__.py
research/
__init__.py
_research.so
stats.pyc

My __init__.py file contains 2 lines:

from stats import *
from _research import *

With the directory containing 'xyzzy' on my
PYTHONPATH, the following occurs:

Python 2.4.2 (#2, Nov 3 2005, 11:35:03)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2
Type "help", "copyright", "credits" or "license" for more
information. Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "xyzzy/research/__init__.py", line 2, in ?
from _research import *
ImportError: No module named _research

Running python with the -vv switch shows python does
indeed look at _research.so but does not load it.

However if I put the directory containing _research.so

Thanks for any help you can offer,

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top