Skip to content

Development build: symbol not found in _path module #11006

Closed

Description

@egpbos

Bug report

Bug summary

On a development build from source, I cannot run the ticks_and_spines/tick-locators.py example, because I get a symbol not found error due to the _path module.

Code for reproduction

python examples/ticks_and_spines/tick-locators.py

Actual outcome

Traceback (most recent call last):
  File "examples/ticks_and_spines/tick-locators.py", line 10, in <module>
    import matplotlib.pyplot as plt
  File "/Users/pbos/sw/src/git/matplotlib/lib/matplotlib/pyplot.py", line 29, in <module>
    import matplotlib.colorbar
  File "/Users/pbos/sw/src/git/matplotlib/lib/matplotlib/colorbar.py", line 28, in <module>
    import matplotlib.artist as martist
  File "/Users/pbos/sw/src/git/matplotlib/lib/matplotlib/artist.py", line 16, in <module>
    from .path import Path
  File "/Users/pbos/sw/src/git/matplotlib/lib/matplotlib/path.py", line 17, in <module>
    from . import _path, rcParams
ImportError: dlopen(/Users/pbos/sw/src/git/matplotlib/lib/matplotlib/_path.cpython-36m-darwin.so, 2): Symbol not found: __ZNSs4_Rep20_S_empty_rep_storageE
  Referenced from: /Users/pbos/sw/src/git/matplotlib/lib/matplotlib/_path.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/pbos/sw/src/git/matplotlib/lib/matplotlib/_path.cpython-36m-darwin.so

Expected outcome

A plot with the tick locators. I am able to produce this plot with the conda-installed matplotlib in my default environment.

Matplotlib version

  • Operating system: macOS High Sierra (10.13.3)
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:14:23) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin

I built matplotlib from source. The build setup output:

    BUILDING MATPLOTLIB
                matplotlib: yes [1.5.1+9314.gade70d705.dirty]
                    python: yes [3.6.5 |Anaconda, Inc.| (default, Mar 29 2018,
                            13:14:23)  [GCC 4.2.1 Compatible Clang 4.0.1
                            (tags/RELEASE_401/final)]]
                  platform: yes [darwin]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.14.2]
          install_requires: yes [handled by setuptools]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: yes [version 2.9.0]
                       png: yes [version 1.6.34]
                     qhull: yes [pkg-config information for 'libqhull' could not
                            be found. Using local copy.]

    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: no  [skipping due to configuration]
            toolkits_tests: no  [skipping due to configuration]

    OPTIONAL BACKEND EXTENSIONS
                    macosx: yes [installing, darwin]
                    qt5agg: no  [PySide2 not found; PyQt5 not found]
                    qt4agg: no  [PySide not found; PyQt4 not found]
                   gtk3agg: no  [Requires pygobject to be installed.]
                 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                     wxagg: no  [requires wxPython]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: no  [Microsoft Windows only]

    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]

Activity

  1. egpbos commented on Apr 9, 2018

    @egpbos
    ContributorAuthor

    Changing backend does not help (default was macosx, also tried Agg and TkAgg).

  2. egpbos commented on Apr 9, 2018

    @egpbos
    ContributorAuthor

    A bit more info on the environment setup. I first clone and enter the matplotlib repo directory. Then I build the conda env:

    conda create -n mpl_dev matplotlib clang libpng freetype
    conda activate mpl_dev
    conda uninstall matplotlib
    rehash  # or hash -r for bash, I'm on zsh

    I then build, but specify the compilers manually, to make sure it doesn't accidentally pick up some MacPorts or system gcc version:

    export CC=clang
    export CXX=clang
    python -mpip install -e .
    

    I also tried everything using pythonw (conda install python.app), but this gives the same result. Also tried installing without the -e flag, again same result.

  3. QuLogic commented on Apr 9, 2018

    @QuLogic
    Member
               matplotlib: yes [1.5.1+9314.gade70d705.dirty]
    

    Commit ade70d7 does not exist. There were also less than 9314 commits between 1.5.1 and 2.2.2, so your clone is out-of-date. Please fetch upstream tags to get a reasonable version number.

    export CXX=clang

    This should be CXX=clang++.

  4. egpbos commented on Apr 9, 2018

    @egpbos
    ContributorAuthor

    @QuLogic I was indeed wondering about that, thanks for the tip. I did have the latest commits, just not the tags.

    The clang++ tip did the trick though, thanks a lot!

    For completeness' sake:

    • I installed it using conda install clangxx.
    • After that I got the RuntimeError: Python is not installed as a framework. which is due to the macosx backend. Running with pythonw (installed with conda install python.app) fixes that and runs the test again.
  5. egpbos commented on Apr 9, 2018

    @egpbos
    ContributorAuthor

    Just to summarize, here's what I need to get it correctly installed from scratch (inside a clean matplotlib clone):

    conda create -n mpl_dev matplotlib clang clangxx libpng freetype pkg-config python.app
    conda activate mpl_dev
    conda uninstall matplotlib
    export CC=clang
    export CXX=clang++
    python -mpip install -e .
    

    And then run with pythonw to use the macosx backend (or switch to Agg or TkAgg in matplotlibrc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions