yglukhov / nimpy

Nim - Python bridge
MIT License
1.48k stars 60 forks source link

can I use LD_LIBRARY_PATH to fix cannot find libpython on macOS #306

Open lewisl opened 2 months ago

lewisl commented 2 months ago

I've tried your recommended solution, but that command doesn't run. So, this seems like a more permanent solution by putting:

export LD_LIBRARY_PATH=/opt/homebrew/Cellar/python@3.11/3.11.9_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/config-3.11-darwin/libpython3.11.dylib

in my .zhrc

lewisl commented 2 months ago

I figured it out:

import nimpy/py_lib as lib
pyInitLibPath("/Library/Frameworks/Python.framework/Versions/3.12/Python")

Sadly, this is neither general nor portable. Any way to create solution that doesn't require the import and call every time?

My python install is from Python.org, so as standard as can be.