python-3.xdyld

dyld cache '/System/Library/dyld/dyld_shared_cache_x86_64h' not loaded: syscall to map cache into shared region failed


I'm getting this error when trying to use python 3. How can I solve this issue?

dyld[2675]: dyld cache '/System/Library/dyld/dyld_shared_cache_x86_64h' not loaded: syscall to map cache into shared region failed dyld[2675]: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python Reason: tried: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file), '/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation' (no such file)


Solution

  • This looks like you've got multiple installations of Python 3 that may have carried over from a previous macOS upgrade. If you directly type /usr/bin/python3 and don't get an error then this is likely an issue with a homebrew/macports/something else custom installation. You can type which python3 to see what it would execute by default when just using python3, but the fix depends on what you've done to your system. Check dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation for more help.