ImportError while doing import mapnik in Python, in Ubuntu 15.10

Bug #1510495 reported by andxwl1
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-mapnik (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

In Ubuntu 15.10:

1 install python-mapnik with:

sudo apt-get install python-mapnik

2 in a Python console, execute:

import mapnik

Expected result: mapnik module is imported.

Result:

  File "/usr/lib/python2.7/dist-packages/mapnik/__init__.py", line 74, in <module>
    from ._mapnik import *
ImportError: /usr/lib/python2.7/dist-packages/mapnik/_mapnik.x86_64-linux-gnu.so: undefined symbol: _ZN6mapnik6filter19parse_image_filtersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorINS_4util7variantIJNS0_4blurENS0_4grayENS0_14agg_stack_blurENS0_6embossENS0_7sharpenENS0_11edge_detectENS0_5sobelENS0_10x_gradientENS0_10y_gradientENS0_6invertENS0_10scale_hslaENS0_14colorize_alphaENS0_14color_to_alphaEEEESaISP_EE

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: python-mapnik 1:0.0~20150817-da1d9dd-1
ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
Uname: Linux 4.2.0-16-generic x86_64
ApportVersion: 2.19.1-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Oct 27 12:05:30 2015
InstallationDate: Installed on 2015-03-11 (230 days ago)
InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
ProcEnviron:
 LANGUAGE=it
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=it_IT.UTF-8
 SHELL=/bin/bash
SourcePackage: python-mapnik
UpgradeStatus: Upgraded to wily on 2015-10-25 (1 days ago)

Revision history for this message
andxwl1 (andxwl1) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-mapnik (Ubuntu):
status: New → Confirmed
Revision history for this message
Kevin Kenny (kennykb) wrote :

Demangling the failed import:

ImportError: /usr/lib/python2.7/dist-packages/mapnik/_mapnik.x86_64-linux-gnu.so: undefined symbol: mapnik::filter::parse_image_filters(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<mapnik::util::variant<mapnik::filter::blur, mapnik::filter::gray, mapnik::filter::agg_stack_blur, mapnik::filter::emboss, mapnik::filter::sharpen, mapnik::filter::edge_detect, mapnik::filter::sobel, mapnik::filter::x_gradient, mapnik::filter::y_gradient, mapnik::filter::invert, mapnik::filter::scale_hsla, mapnik::filter::colorize_alpha, mapnik::filter::color_to_alpha>, std::allocator<mapnik::util::variant<mapnik::filter::blur, mapnik::filter::gray, mapnik::filter::agg_stack_blur, mapnik::filter::emboss, mapnik::filter::sharpen, mapnik::filter::edge_detect, mapnik::filter::sobel, mapnik::filter::x_gradient, mapnik::filter::y_gradient, mapnik::filter::invert, mapnik::filter::scale_hsla, mapnik::filter::colorize_alpha, mapnik::filter::color_to_alpha> > >&)

Changed in python-mapnik (Ubuntu):
importance: Undecided → Medium
Revision history for this message
andxwl1 (andxwl1) wrote :

xreal on #mapnik irc suggests to check if this is related to https://github.com/mapnik/python-mapnik/issues/62

Revision history for this message
andxwl1 (andxwl1) wrote :

Speaking about #4
I changed mapniklibpath = '/usr/lib/mapnik' to mapniklibpath = '/usr/lib/mapnik/3.0' in /usr/lib/python2.7/dist-packages/mapnik
But the error is still there.

Revision history for this message
GautierPortet (kassoulet) wrote :

This is the symbol looked by python-mapnik:
_ZN6mapnik6filter19parse_image_filtersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorINS_4util7variantIJNS0_4blurENS0_4grayENS0_14agg_stack_blurENS0_6embossENS0_7sharpenENS0_11edge_detectENS0_5sobelENS0_10x_gradientENS0_10y_gradientENS0_6invertENS0_10scale_hslaENS0_14colorize_alphaENS0_14color_to_alphaEEEESaISP_EE

This is the closest symbol in /usr/lib/libmapnik.so.3.0:
_ZN6mapnik6filter19parse_image_filtersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSt6vectorINS_4util7variantIINS0_4blurENS0_4grayENS0_14agg_stack_blurENS0_6embossENS0_7sharpenENS0_11edge_detectENS0_5sobelENS0_10x_gradientENS0_10y_gradientENS0_6invertENS0_10scale_hslaENS0_14colorize_alphaENS0_14color_to_alphaENS0_21color_blind_protanopeENS0_23color_blind_deuteranopeENS0_21color_blind_tritanopeEEEESaISS_EE

Looks like color_blind_* are missing, probably not compiled with the right version?

Revision history for this message
GautierPortet (kassoulet) wrote :

Rebuilding the source package fixed it for me.

Revision history for this message
Hartmut Holzgraefe (hartmut-php) wrote :

Similar problem here, but I'm getting "generate_image_filters" instead of "parse_image_filters" in the error message:

$ cat test.py
import mapnik

$ python test.py
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    import mapnik
  File "/usr/lib/python2.7/dist-packages/mapnik/__init__.py", line 74, in <module>
    from ._mapnik import *
ImportError: /usr/lib/python2.7/dist-packages/mapnik/_mapnik.i386-linux-gnu.so: undefined symbol: _ZN6mapnik6filter22generate_image_filtersERSt20back_insert_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERKSt6vectorINS_4util7variantIJNS0_4blurENS0_4grayENS0_14agg_stack_blurENS0_6embossENS0_7sharpenENS0_11edge_detectENS0_5sobelENS0_10x_gradientENS0_10y_gradientENS0_6invertENS0_10scale_hslaENS0_14colorize_alphaENS0_14color_to_alphaEEEESaISQ_EE

$ c++filt
_ZN6mapnik6filter22generate_image_filtersERSt20back_insert_iteratorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERKSt6vectorINS_4util7variantIJNS0_4blurENS0_4grayENS0_14agg_stack_blurENS0_6embossENS0_7sharpenENS0_11edge_detectENS0_5sobelENS0_10x_gradientENS0_10y_gradientENS0_6invertENS0_10scale_hslaENS0_14colorize_alphaENS0_14color_to_alphaEEEESaISQ_EE
mapnik::filter::generate_image_filters(std::back_insert_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, std::vector<mapnik::util::variant<mapnik::filter::blur, mapnik::filter::gray, mapnik::filter::agg_stack_blur, mapnik::filter::emboss, mapnik::filter::sharpen, mapnik::filter::edge_detect, mapnik::filter::sobel, mapnik::filter::x_gradient, mapnik::filter::y_gradient, mapnik::filter::invert, mapnik::filter::scale_hsla, mapnik::filter::colorize_alpha, mapnik::filter::color_to_alpha>, std::allocator<mapnik::util::variant<mapnik::filter::blur, mapnik::filter::gray, mapnik::filter::agg_stack_blur, mapnik::filter::emboss, mapnik::filter::sharpen, mapnik::filter::edge_detect, mapnik::filter::sobel, mapnik::filter::x_gradient, mapnik::filter::y_gradient, mapnik::filter::invert, mapnik::filter::scale_hsla, mapnik::filter::colorize_alpha, mapnik::filter::color_to_alpha> > > const&)

Revision history for this message
Bas Couwenberg (sebastic) wrote :

Should be fixed with python-mapnik (1:0.0~20151125-92e79d2-1) in xenial.

Changed in python-mapnik (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.