dyld: Library not loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

Solution 1:

This worked for me with the same issue.

Check if you have multiple Python3.x versions installed. In my case I had Python3.6 and Python3.9 installed. brew uninstall python3 did not remove Python3.6 completely.

I was able to call Python3.9 from Terminal by explicitly running python3.9 instead of python3, which led me to believe the issue was caused by ambiguity in which Python3.x resource was to be used.

Manually deleted /Library/Frameworks/Python.framework/Versions/3.6 resulted in Python3 running as expected.

hint: It may be sufficient to remove /Library/Frameworks/Python.framework/Versions/3.6 from your PATH environment variable.

Solution 2:

Check in the location:

/usr/bin/python3

If you can invoke python3 interpreter from this location without any issues, copy this to

/usr/local/bin/python3

I upgraded to macOS Big Sur and had faced the same issue. I was not able to open Python interpreter from terminal and the Python version inside Library/Frameworks/Python.framework/Versions/3.6 was also being pointed to Python2.7.

Later, I found python3 in location /usr/bin/python3 working fine for me. I also tried creating a symlink for python3 to the above path but didn't work.