Error message "The 'cmappertools' module could not be imported."

39 views
Skip to first unread message

Joao Tragtenberg

unread,
Jun 16, 2020, 3:56:57 PM6/16/20
to dot_m...@googlegroups.com
Hello,

I am trying to install libmapper on my computer and following the documentation https://github.com/libmapper/libmapper/blob/master/doc/how_to_compile_and_run.md I almost got it working.

I downloaded the https://github.com/libmapper/libmapper/archive/v1.2a.tar.gz file, and ran inside the folder the following commands:
- brew install liblo
./autogen.sh
- ./configure
make
make install

I then ran "pkg-config --libs --cflags libmapper" and it showed a message I don't know if it means the installation worked or not, I suppose it did work:

-I/usr/local/include/mapper -I/usr/local/Cellar/liblo/0.31/include -L/usr/local/lib -L/usr/local/Cellar/liblo/0.31/lib -lmapper -llo


But when I ran the python test.py in the "swig" folder it didn't find many libraries that I managed to install with pip, but even after installing cmappertools, it still gives me this error message: 

Giromin:swig dega$ python test.py

The 'cmappertools' module could not be imported.

The 'cmappertools' module could not be imported.

Intrinsic metric is not available.

The 'cmappertools' module could not be imported.

Traceback (most recent call last):

  File "test.py", line 6, in <module>

    start = mapper.timetag()

AttributeError: 'module' object has no attribute 'timetag'


Does that mean I didn't install libmapper properly?

Thank you for you help and amazing work!

João Tragtenberg

Stephen Sinclair

unread,
Jun 16, 2020, 4:25:29 PM6/16/20
to dot_m...@googlegroups.com
Are you on Mac or Linux?

It's either not finding the module or not finding the shared library.

Since it looks like it did compile fine (pkg-config found it) then
it's probably a matter of setting PYTHONPATH or LD_LIBRARY_PATH such
that it can find libmapper.so (or on Mac, DYLD_LIBRARY_PATH and
libmapper.dylib)

Good idea about making it available through pip though, I actually
didn't think about that. Something to work on.

Steve
> --
> You received this message because you are subscribed to the Google Groups "dot_mapper" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dot_mapper+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/dot_mapper/CAEYuk1axeC43-3djzNkRNAArioQVzndjPts9GfQ8k370kioirQ%40mail.gmail.com.

Joseph Malloch

unread,
Jun 16, 2020, 4:31:38 PM6/16/20
to dot_m...@googlegroups.com
Hi Joao,

Depending on how you have your system configured you might have to use $ python3 test.py

Joe
> To view this discussion on the web visit https://groups.google.com/d/msgid/dot_mapper/CADopUHZ43GRBi4aJFENqVq2SecEvgVAH6tE3CxFN4g5SAP5QDg%40mail.gmail.com.

Joao Tragtenberg

unread,
Jun 16, 2020, 5:34:34 PM6/16/20
to dot_m...@googlegroups.com
Thank you for your fast response!

I'm using MacOS 10.14.6
my python binary is the 2.7.16 version and my python3 is on version 3.7.7
I saved my PYTHONPATH to /usr/bin , where both python and python3 binaries are.
I didn't set LD_LIBRARY_PATH or DYLD_LIBRARY_PATH anywhere and they are not set to anywhere in my system.
I don't know either where the libmapper.dylib was saved. looked in /usr/local but didn't find it.

With python3 I had the same problem, after pip3 installing all the dependencies, here is the error message:
Giromin:swig dega$ python3 test.py
Mapper warning: Could not load the module “fastcluster”.
The module “scipy.cluster.hierarchy“ is used instead, but it will be slower.

The 'cmappertools' module could not be imported.
The 'cmappertools' module could not be imported.
Intrinsic metric is not available.
The 'cmappertools' module could not be imported.
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    start = mapper.timetag()
AttributeError: module 'mapper' has no attribute 'timetag'


What should I do?

João


Joseph Malloch

unread,
Jul 17, 2020, 4:03:54 PM7/17/20
to dot_m...@googlegroups.com
Hi João,

Did you get things working? From the messages you posted it looks like you have another module called “mapper” installed on your machine. Is this something you are using or was it installed by accident when looking for libmapper?

Regards,
Joe

Joao Tragtenberg

unread,
Aug 2, 2020, 1:06:31 PM8/2/20
to dot_m...@googlegroups.com
Hello Joe,

I haven't yet made it work, but for now I will be ok with using the max external.
I couldn't find any mapper binary, but there seems to be a python library called mapper at: /usr/local/lib/python3.7/site-packages/mapper
Do you believe that could be in conflict somehow?
That was the only mapper I found here.

Thanks
João


Joseph Malloch

unread,
Aug 2, 2020, 1:13:17 PM8/2/20
to dot_m...@googlegroups.com
Hi João,

From the error message you posted I thought it might be this one: http://danifold.net/mapper/introduction.html. If this isn’t something you meant to install you should install it before trying to use the libmapper python bindings.

Cheers,
Joe

Stephen Sinclair

unread,
Aug 2, 2020, 2:36:43 PM8/2/20
to dot_m...@googlegroups.com
Huh interesting, maybe we should rename the python module to libmapper and work on a wheel for pypi..
Hadn't thought of that.  Not sure how easy it would be, I haven't done a python wheel before let alone containing a C lib, but I'd be willing to try.

Steve


Reply all
Reply to author
Forward
0 new messages