"from opencog.atomspace import AtomSpace" not working with python3

51 views
Skip to first unread message

Eyob

unread,
Feb 27, 2018, 9:32:30 AM2/27/18
to opencog
I am building opencog inside docker. After successful build, i ran  "from opencog.atomspace import AtomSpace"  on python3 and get this error


>>> from opencog.atomspace import AtomSpace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_atomspace)


what could be the cause of this error, "ImportError: dynamic module does not define module export function (PyInit_atomspace)"?


Eyob

unread,
Feb 27, 2018, 11:56:46 AM2/27/18
to opencog
Apparently it worked with python 3.5 inside ubuntu16.04. But I got this error with ubutnu 14.04 in python 3.4.

Linas Vepstas

unread,
Feb 27, 2018, 7:13:14 PM2/27/18
to opencog
Are you sure that you build the python3 and not the python2 bindings?

See, for, for example: build/opencog/cython/opencog/atomspace.cpp
around line 16267 or so (search for PyInit_atomspace).

You can also look at symbols: the nm command the num command dumps
the symbol table in an object, so for example:

nm opencog/cython/opencog//atomspace.so |less
nm opencog/cython/opencog//atomspace.so |grep PyInit

All C/C++ programmers should know the nm command, and be familiar with
what it does, and if you are working with cython, you should be
familiar with the files that cython generates (such as
build/opencog/cython/opencog/atomspace.cpp)

--linas


On Tue, Feb 27, 2018 at 10:56 AM, Eyob <edyi...@gmail.com> wrote:
> Apparently it worked with python 3.5 inside ubuntu16.04. But I got this
> error with ubutnu 14.04 in python 3.4.
>
> --
> You received this message because you are subscribed to the Google Groups
> "opencog" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to opencog+u...@googlegroups.com.
> To post to this group, send email to ope...@googlegroups.com.
> Visit this group at https://groups.google.com/group/opencog.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/opencog/44938c92-43b4-403e-a521-4f9503708d6a%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
cassette tapes - analog TV - film cameras - you
Reply all
Reply to author
Forward
0 new messages