mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
157 stars 91 forks source link

ImportError: undefined symbol: PyString_Type #211

Open bescbe opened 4 years ago

bescbe commented 4 years ago

Dear community, my OS is Ubuntu 18.04 x86-64 with python 3.6. All uptodate.

I successfully built and installed mapnik, 3.0.x branch from source by using the mason packages. But I cannot get python-mapnik to work properly. I am desperate. I think it may have something to do with the boost libraries because other users with similar error messages often seem to have trouble with those libs. Mason is providing the boost 1.65.1 libs. So is Ubuntu 18.04.

For python-mapnik I use a virtualenv as recommended. I checked out 3.0.x branch from the repository, hoping it is compatible with the current mapnik 3.0.x branch. Because I found numerous recommendations to do so, I set the following environment vars to make python-mapnik build against the boost libs installed on my system:

export BOOST_PYTHON_LIB=boost_python
export BOOST_THREAD_LIB=boost_thread
export BOOST_SYSTEM_LIB=boost_system

The built and install of the python-mapnik module is successful. But when I try to import it, I get this error message:

(venv) peter@XVM:~$ python3 -c "import mapnik"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/peter/OSM/venv/lib/python3.6/site-packages/mapnik-0.1-py3.6-linux-x86_64.egg/mapnik/__init__.py", line 74, in <module>
    from ._mapnik import *
ImportError: /home/peter/OSM/venv/lib/python3.6/site-packages/mapnik-0.1-py3.6-linux-x86_64.egg/mapnik/_mapnik.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyString_Type

Does anybody have an idea what went wrong? If this is about the boost libs, can anybody explain it to me?

Thanks for your help in advance! Peter

lightmare commented 4 years ago

Mason boost_python packages have so far been built against Python 2.7. There are currently no packages for Python 3.