python-mapnik icon indicating copy to clipboard operation
python-mapnik copied to clipboard

Error: _mapnik.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyString_Type

Open Ogofo opened this issue 7 years ago • 2 comments

Hey guys,

I installed mapnik from source and tried to install the python bindings as well. When I import mapnik I get an error. Can anyone help me?

(mapnik) prompt:~/python-mapnik$ mapnik-config -v
3.1.0
(mapnik) prompt:~/python-mapnik$  python
Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapnik
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/.../python-mapnik/mapnik/__init__.py", line 74, in <module>
    from ._mapnik import *
ImportError: /home/.../python-mapnik/mapnik/_mapnik.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyString_Type

Ogofo avatar Jul 04 '18 14:07 Ogofo

I have a same problem

sergeychibunin avatar Jul 11 '18 09:07 sergeychibunin

I discovered that is due to the inconsistency of the libboost-python libraries and the python version for which mapnik is building. In my case, docker container python:3.6-strech had python3.5 as system and, accordingly, libboost-python1.62 but build for python3.6. Therefore, mapnik needs to be built for python3.5 or update libboost-python to version 1.67. I was build mapnik in a debian:buster container and it's work fine. But you can don't build mapnik and just take from ppa. In buster system python is 3.7 and mapnik in ppa build for it.

pinballwizard avatar Mar 18 '19 06:03 pinballwizard