I need to install mapnik / mapnik-python on Ubuntu 16.04 (existing server) Both libraries compiled without any problems, but the python mapnik module does not work. After importing the mapnik module, I get an 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) >>>
The module is associated with libboost 1.58:
/usr/local/lib/python2.7/dist-packages/mapnik-0.1-py2.7-linux-x86_64.egg/mapnik
C ++ code is 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 the accelerated library manual and found that std :: string const & is the correct type declaration. This seems to be a boost library error.
Is there any way to make it work? Is there a way to lower libboost_python in Ubuntu16.04?
Update . I looked at the compiled _mapnik.so file with nm -C and found this:
U mapnik::datasource_cache::register_datasources(std::string const&, bool)
There is one more parameter in the added function. This is normal?