question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"hello world" on macOS Mojave and miniconda - dyld: Library not loaded

See original GitHub issue

Hello all, first try with miniconda installation of Nuitka, with a simple hello-world script on macOS Mojave. Here the key info:

  • Python and Nuitka version:
nuitka: 0.6.5
Python: 3.7.4 (default, Aug 13 2019, 15:17:50) 
OS: Darwin
Arch: x86_64
  • Tested both with Python3 and Nuitka installed from conda-forge and with Python3 from miniconda main and Nuitka installed from PyPI.

  • Compiled with: python -m nuitka hello.py tried also with --standalone

  • hello.py source from Nuitka documentation:

def talk(message):
    return "Talk " + message

def main():
    print(talk("Hello World"))

if __name__ == "__main__":
    main()
  • No error at compile time (also checked with --verbose and --show-scons)

  • Always get the following error at runtime:

dyld: Library not loaded: @rpath/libpython3.7m.dylib
  Referenced from: /Users/gioboske/dev/nuitka/hello.dist/./hello
  Reason: image not found
Abort trap: 6

Am I missing something obvious? Thank you.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
gioboskecommented, Nov 25, 2019

Finally, I found some time to debug, following your suggestion to look into the code in nuitka.freezer.Standalone for otool output.

As far as I understood, nuitka finds no “rpaths” (in _detectBinaryRPathsMacOS): while processing the output of otool -l on the executable, only the cmd LC_RPATH load commands are considered. Unfortunately, no cmd LC_RPATH are present in the output of otoll -l and @rpath/libpython3.7m.dylib only appears as follows:

Load command 13
          cmd LC_LOAD_DYLIB
      cmdsize 56
         name @rpath/libpython3.7m.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 3.7.0
compatibility version 3.7.0

I think this explains why the library is not copied in the dist folder. , but I didn’t get why the error persists also when compiling without the --standalone option, manual copying the library next to hello.bin. In addition, since the library is not included in dll_map variable, the install_name_tool is not called, so the error persists also manual copying the library next to executable.

@kayhayen, do you have some additional suggestions?

0reactions
kayhayencommented, Aug 29, 2022

@mysakbm posting below existing issues is a surefire way to get ignored

Read more comments on GitHub >

github_iconTop Results From Across the Web

macos - dyld: Library not loaded ... Reason: Image not found
I have installed the boost libraries and they are located in /opt/local/lib . I think the problem has something to do with the...
Read more >
Clang linking error MacOS Big Sur | Apple Developer Forums
I believe it is this: in Big Sur system dynamic link libraries are not available as separate entities. They're pre-loaded. The -l switch...
Read more >
macOS for deep learning with Python, TensorFlow, and Keras
Inside this tutorial you'll learn how to configure your macOS machine for deep learning using Python, Keras, and TensorFlow.
Read more >
cannot load 'libomp.dylib' | The Search Engine You Control
Bug I tried to install PyTorch, but I can't use it. It can't link dynamic library libomp.dylib To Reproduce Steps to reproduce the...
Read more >
Dyld_ library not loaded_ @rpath - miocittadino.it
Nov 15, 2016 · Hi ALangHung, Sorry for the delayed response. dylib - fontforge ... Apr 27, 2020 · How to Fix 'Dyld:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found