Open am2222 opened 5 years ago
This happens when python-mapnik bindings (_mapnik.so) is compiled against different C++ STL than the Boost.Python library it uses. Python call DatasourceCache.register_datasources(str)
apparently does match C++ signature register_datasources(std::string)
; problem is that the std::string
class in python-mapnik is unrelated to the std::string
class that Boost.Python has builtin converter for.
If you're linking with dynamic libraries, you can check whether they match with ldd:
$ ldd bindings/python/mapnik/_mapnik.so | grep -Fe c++ -e boost
libboost_python-py27.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1 (0x00007f0dda221000)
libboost_thread.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 (0x00007f0dd9ffc000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0dd9c73000)
libboost_system.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 (0x00007f0dd8ea8000)
$ ldd /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1 | grep -Fe c++ -e boost
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4f10b77000)
If you're building python-mapnik with libraries from Mason, there's a quirk in setup.py
that it looks for shared boost libraries even though Mason provides static libraries, and you may end up with the wrong mix linked in. You can check what it finds with python setup.py whichboost
, and if that's wrong, override with export BOOST_PYTHON_LIB=boost_python
before running python setup.py install
.
@lightmare thanks so much, I'll check your solution. it is for a long time that I am struggling with this error.
Hi, I have tried to install python-mapnik on ubunto but faced some issues. I have already tested these versions, 1- Installed last mapnik version from its repo with no problem. 2- installed the latest python-mapnik libaray from repo. (I tried to use v3.0.x branch) but it did not work (it throws 'mapnik/bbox2d.hpp' not found) so I switched to master repo and it worked and it is installed fine.
But when I tried to call 'import mapnik' I faced this error
Is there any way to find the source of this error?