Having multiple python3 directories after single installation

I recently switched to mac so I appreciate it if one help me to figure out this problem regarding python installation.

I downloaded and installed python 3.9 (only once), when I search python3 directory using the command "where python3" there are three of them :

/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
/usr/local/bin/python3
/usr/bin/python3

Also when using Pycharm as the IDE to create a project there are more options to choose as the "base interpreter" :

/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
/usr/local/bin/python3
/usr/local/bin/python3.9
/usr/bin/python3

can one let me know why this happened? which one is the main one and how can I remove the unnecessary directories?

Thanks a lot

Welcome to Mac!

/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 is the python you installed. /usr/local/bin/python3 and /usr/local/bin/python3.9 are symlinks (which is like a shortcut on Windows) to your python. /usr/bin/python3 is the python that ships with macOS.

You don't need to change a thing. Everything is installed correctly. Choose /usr/local/bin/python3 in your IDE.

Having multiple python3 directories after single installation
 
 
Q