简体   繁体   中英

Python quit unexpectedly on Mac

I have installed python3 from the here

When I try to run 'python3', it quits and give these information:

Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings'

Current thread 0x00007fff960a93c0 (most recent call first): Abort trap: 6

Before that, I try to install python3 from Homebrew.

I don't remember whether I have to delete the build in python frameworks in the /Library/Frameworks/Python.framework

os : macOS

by the way, the IDLE works well

If you are using Homebrew , you can reinstall a corrupted Python environment like this:

brew uninstall --ignore-dependencies --force python python@2
unset PYTHONPATH
brew install python python@2

I had a similar "quit unexpectedly" issue and this resolved it for me. pip and pip3 are both working fine after without messing with them.

brew reinstall openssl

Then:

cd /usr/local/lib
sudo ln -s /usr/local/opt/openssl/lib/libssl.dylib libssl.dylib
sudo ln -s /usr/local/opt/openssl/lib/libcrypto.dylib libcrypto.dylib

I have installed python3 from the here

When I try to run 'python3', it quits and give these information:

Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings'

Current thread 0x00007fff960a93c0 (most recent call first): Abort trap: 6

Before that, I try to install python3 from Homebrew.

I don't remember whether I have to delete the build in python frameworks in the /Library/Frameworks/Python.framework

os : macOS

by the way, the IDLE works well

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM