I have to install mapnik/mapnik-python on Ubuntu 16.04 (existing server) Both libraries compiled without any problem but python mapnik module doesn't work. After importing mapnik module i get error:
/home/user# python
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapnik
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mapnik/__init__.py", line 1075, in <module>
register_plugins()
File "mapnik/__init__.py", line 1057, in register_plugins
DatasourceCache.register_datasources(path)
Boost.Python.ArgumentError: Python argument types in
DatasourceCache.register_datasources(str)
did not match C++ signature:
register_datasources(std::string)
>>>
Module is linked against libboost 1.58:
/usr/local/lib/python2.7/dist-packages/mapnik-0.1-py2.7-linux-x86_64.egg/mapnik# ldd _mapnik.so
linux-vdso.so.1 => (0x00007ffc3f7fb000)
libmapnik.so.3.0 => /usr/local/lib/libmapnik.so.3.0 (0x00007f093ad96000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f093ab7c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f093a977000)
libboost_python-py27.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.58.0 (0x00007f093a72b000)
libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 (0x00007f093a505000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f093a2fc000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0939f7a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0939c71000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0939a5a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f093983d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0939474000)
/lib64/ld-linux-x86-64.so.2 (0x000055969793c000)
libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f093926f000)
C++ code defined as:
void register_datasources(std::string const& path)
{
mapnik::datasource_cache::instance().register_datasources(path);
}
Python code:
def register_plugins(path=None):
"""Register plugins located by specified path"""
if not path:
if 'MAPNIK_INPUT_PLUGINS_DIRECTORY' in os.environ:
path = os.environ.get('MAPNIK_INPUT_PLUGINS_DIRECTORY')
else:
from .paths import inputpluginspath
path = inputpluginspath
DatasourceCache.register_datasources(path)
I studied a boost library manual and found that std::string const& is a correct type declaration. It looks like this is a boost library bug.
Is there any way to get it working ? Is there any way to downgrade libboost_python in Ubuntu16.04 ?
Update: I looked into compiled _mapnik.so file using nm -C
and found this:
U mapnik::datasource_cache::register_datasources(std::string const&, bool)
There is one more parameter in function added. Is it normal ?