linux – messed up the python environment of my centOS server

I accidentally messed up the python environment of my centOS server. My python3 soft link was linked to the anaconda path. Now I want to link the python3 soft link to the original /usr/bin/python3.7, but when running the python3 command, the following error message pops up.
Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: initfsencoding: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings'

I tried setting PYTHONHOME and PYTHONPATH via
export PYTHONHOME="/usr/lib/python3.7" export PYTHONPATH /usr/bin

Read more here: Source link