开发者

python module installed and recognized, but unable to import it on my code or python 2.7.1 interpreter on Ubuntu

I'm stuck trying to get a python C module up and running. I'm installing deltaLDA module from Here. I followed the instructions as specified in REAMDE file. As usual, I wrote:

sudo python setup.py install

Everything went as expected I guess, I get this output:

    running build
    running build_ext
    building 'deltaLDA' extension
    C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC

    creating build
    creating build/temp.linux-i686-2.7
    compile options: '-I/media/Hub/DropBox/Dropbox/Betazeta/Software/LDA/deltaLDA -I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -c'
    extra options: '-O3 -Wall'
    gcc: deltaLDA.c
    In file included from /usr/include/python2.7/Python.h:8:0,
                     from deltaLDA.c:22:
    /usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
    /usr/include/features.h:214:0: note: this is the location of the previous definition
    deltaLDA.c:686:1: warning: function declaration isn’t a prototype
    creating build/lib.linux-i686-2.7
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/deltaLDA.o -o build/lib.linux-i686-2.7/deltaLDA.so
    running install_lib
    copying build/lib.linux-i686-2.7/deltaLDA.so -> /usr/local/lib/python2.7/dist-packages
    running install_egg_info
    Removing /usr/local/lib/python2.7/dist-packages/deltaLDA-0.1.1.egg-info
    Writing /usr/local/lib/python2.7/dist-packages/deltaLDA-0.1.1.egg-info

But then when I try to import deltaLDA module I get the following error:

>>> from deltaLDA import deltaLDA
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named deltaLDA

If I check for installed modules with help('modules') or pip freeze command, I'm able to find deltaLDA on both lists, but I can't import it. Please any help would be appreciated.

Thanks!

Updates: I also verified the sys.path and '/usr/local/lib/开发者_运维技巧python2.7/dist-packages' it's on it. If i try to import * from deltaLDA like from deltaLDA import * I get the same error. On the interpreter also tried dir(deltaLDA) getting the same "No module name" error. Maybe there is a problem with the deltaLDA module? Someone could try to install it?

Fixed

I checked on the permissions of the .so and egg-info files on dist-packages. They weren't readable, I don't know why. I just ran a sudo chmod 777 file and now it's working!.


First try

>>> import deltaLDA

If that works review the docs or see dir(deltaLDA) as @arunkumar says, if not post your sys.path, your egg-info details please

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜