Skip to content

Error on M1 Mac with Miniforge venv  #321

@rickypang0219

Description

@rickypang0219

Hi all. I encounter a problem on compiling the matplotlib-cpp toy code provided in this github repo. I compile the sample code by

g++ test.cpp -std=c++17 \
	-I /Users/pangkachun/matplotlib-cpp \
	-I /Users/pangkachun/miniforge3/envs/np_veclib/include/python3.9 \
	-I /Users/pangkachun/miniforge3/envs/np_veclib/lib/python3.9/site-packages/numpy/core/include \
	-L /Users/pangkachun/miniforge3/envs/np_veclib/lib -lm  \
	-lpython3.9 \
	-o result_plot

However, terminal returns an error message regarding on the libpython3.9.dylib. This file exists in /Users/pangkachun/miniforge3/envs/np_veclib/lib and I have no idea why the error message says not found. The error messgae is listed below:

dyld[37343]: Library not loaded: @rpath/libpython3.9.dylib
  Referenced from: /Users/pangkachun/result_plot
  Reason: tried: '/usr/local/lib/libpython3.9.dylib' (no such file), '/usr/lib/libpython3.9.dylib' (no such file)
zsh: abort      ./result_plot

Is there any guideline to help me to solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions