If you are facing issues while installing Python on your Mac or getting errors after installing it, I suggest you re-install it using all the steps followed in this blog. Please refer to the "Install Anaconda on Mac" section of the blog in case you're using a Mac.
Also, make sure you create the environment (this is covered in the blog) by running this command:
A) For creating new environment with machine learning libraries: