ImportError: No module named _ckernel

Help
2008-08-14
2013-04-24
  • mark pearrow
    mark pearrow
    2008-08-14

    I've tried building PyML 0.7.0 on three different Debian permutations:

    1) 64-bit Etch, Python 2.4
    2) 64-bit Etch, Python 2.5
    3) 64-bit Lenny, Python 2.5

    In all cases, once I have built PyML and installed it, when I try to import it I get the following error:

    >>> import PyML
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "PyML/__init__.py", line 4, in <module>
        from PyML.containers import *
      File "PyML/containers/__init__.py", line 3, in <module>
        VectorDataSet = __import__('PyML.containers.vectorDatasets', fromlist=['']).VectorDataSet
      File "PyML/containers/vectorDatasets.py", line 4, in <module>
        from PyML.containers.baseDatasets import WrapperDataSet, BaseVectorDataSet
      File "PyML/containers/baseDatasets.py", line 4, in <module>
        from PyML.containers import ker
      File "PyML/containers/ker.py", line 6, in <module>
        from ext import ckernel
      File "PyML/containers/ext/ckernel.py", line 7, in <module>
        import _ckernel
    ImportError: No module named _ckernel

    Any idea what is happening? I can see that _ckernel.so exists, is readable, is in the pythonpath, and seems to be OK as far as what it is linked against:

    ldd _ckernel.so
            linux-vdso.so.1 =>  (0x00007fff3a3fe000)
            libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fca31e0e000)
            libm.so.6 => /lib/libm.so.6 (0x00007fca31b8b000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fca31973000)
            libpthread.so.0 => /lib/libpthread.so.0 (0x00007fca31757000)
            libc.so.6 => /lib/libc.so.6 (0x00007fca31404000)
            /lib64/ld-linux-x86-64.so.2 (0x00007fca32379000)

    mjp

     
    • Ralfe Poisson
      Ralfe Poisson
      2009-04-10

      Has this been solved?

      I am having the same problem.

      ralfe

       
  • Adam Oakman
    Adam Oakman
    2010-01-24

    I'm having the same issue on Mac OSX, any solution?

     
  • Pablo Antonio
    Pablo Antonio
    2010-02-23

    I was having the same problem here, and I found "a solution".

    It has to do with Python's search path. When importing a module, Python first tries to find it in the current directory. If it's not there, then it goes and look at every directory in

    PYTHONPATH
    

    .

    You probably tried to import the PyML module while in the directory created after extracting the tar.gz. That directory has a

    PyML/
    

    directory with a file called

    __init__.py
    

    in it. The existence of that file make that directory a Python module. So, when you tried to import the PyML module, Python found it there, and that module wasn't the one you wanted.

    The "solution" is to

    cd
    

    into some other directory and try the import again.

     
  • Pablo Antonio
    Pablo Antonio
    2010-02-23

    Sorry for my last comment's markup. I didn't know the "code tag" would be that ugly, and that Sourceforge wouldn't let me preview and/or edit my comment.