Starfighter
Starfighter

Reputation: 1

Import Error from Matplotlib v. 2.2.2 under Anaconda 5.1 Mac OS X Sierra

I've installed an application PyKep installed under the Anaconda distribution version 5.1 and in running a simple,

import pykep as pk

posted on https://esa.github.io/pykep/examples/ex1.html. The response I get is

(pagmo) Samuels-Mac-Pro:~ user$ python Python 3.6.5 | packaged by conda-forge | (default, Apr 6 2018, 13:44:09) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. import pykep as pk Traceback (most recent call last): File "", line 1, in File "/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/pykep/init.py", line 48, in from pykep import core, sims_flanagan, pontryagin, orbit_plots, examples, phasing, util, planet, trajopt File "/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/pykep/pontryagin/init.py", line 4, in from ._leg import leg File "/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/pykep/pontryagin/_leg.py", line 6, in import matplotlib.pyplot as plt File "/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/matplotlib/pyplot.py", line 31, in import matplotlib.colorbar File "/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/matplotlib/colorbar.py", line 36, in import matplotlib.contour as contour File "/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/matplotlib/contour.py", line 20, in import matplotlib.font_manager as font_manager File "/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/matplotlib/font_manager.py", line 55, in from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir ImportError: dlopen(/Users/user/anaconda3/envs/pagmo/lib/python3.6/site-packages/matplotlib/ft2font.cpython-36m-darwin.so, 2): Symbol not found: _inflateValidate Referenced from: /Users/user/anaconda3/envs/pagmo/lib/libpng16.16.dylib Expected in: /usr/lib/libz.1.dylib in /Users/user/anaconda3/envs/pagmo/lib/libpng16.16.dylib

I'm running this on a Mac Pro under Mac OS X ver. 10.12.6 Sierra, under Python 3.6.5. I'm running Matplotlib ver. 2.2.2.

It appears that I may have some misconfiguration with respect to Matplotlib with it invoking libz in /usr/lib as opposed to using the one under

/Users/user/anaconda3/lib

.

Any suggestions?

Sam Dupree P.S. - I'm still learning Python, so when it comes to solutions please keep it straightforwardly simple (my version of K.I.S.S.)

Upvotes: 0

Views: 226

Answers (1)

cosmoscalibur
cosmoscalibur

Reputation: 1173

You need to change the CMAKE_PREFIX_PATH to point /Users/user/anaconda3/lib.

Upvotes: 0

Related Questions