-1

I am trying to setup Python on IOS Catalina 10.15.7 and I'm really struggling. For starters, I am very green when it comes to using terminal and a lot of the relevant points when it comes to these sort of system level configurations are well over my head so please talk to me like I'm 5.

My ultimate goal here is to get a clean and organized version of python installed on my machine.

At this point I have tried installing python via the website as well as homebrew, and now I'm very confused about what versions I actually have installed, and where those are living. I'm not sure if this would actually be necessary, but I'm thinking I should try and delete all the versions I have installed?

Once I get a clean version installed, my understanding is that I would need to define the path in terminal so that the new version of python3 will be the default for my system.

Additionally, I want to use PYCharm, and ran into some issues there where it was basically saying that I hadn't linked it to the correct python directory yet. I watched some tutorials on this but couldn't emulate any of them because they were all referencing it to a python.exe file, which I couldn't find anywhere.

Here are some terminal outputs which I think might be helpful. Also, FWIW, I changed from bash to ZSH (I don't really understand why or what this means but it was part of one of the tutorials I followed). I'm of course happy to provide any other terminal output if that helps diagnose this...

reilly@Reillys-MacBook-Pro ~ % ls -ls /usr/bin/python
0 lrwxr-xr-x  1 root  wheel  75 Feb 12  2020 /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
reilly@Reillys-MacBook-Pro ~ % which -a python
/usr/local/bin/python
/usr/bin/python
reilly@Reillys-MacBook-Pro ~ % ls -l /usr/bin/python*
lrwxr-xr-x  1 root  wheel     75 Feb 12  2020 /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x  1 root  wheel     82 Feb 12  2020 /usr/bin/python-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
lrwxr-xr-x  1 root  wheel     75 Feb 12  2020 /usr/bin/python2 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x  1 root  wheel     75 Feb 12  2020 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
lrwxr-xr-x  1 root  wheel     82 Feb 12  2020 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
-rwxr-xr-x  1 root  wheel  31488 Oct 30  2020 /usr/bin/python3
lrwxr-xr-x  1 root  wheel     76 Feb 12  2020 /usr/bin/pythonw -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
lrwxr-xr-x  1 root  wheel     76 Feb 12  2020 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
reilly@Reillys-MacBook-Pro ~ % python --version
Python 3.10.4
reilly@Reillys-MacBook-Pro ~ % python3 --version
Python 3.10.4
reilly@Reillys-MacBook-Pro ~ % 

Thanks so much in advance for any and all help!

Grekkq
  • 679
  • 6
  • 14

1 Answers1

1

You have successfully installed Python 3.10.4 on your macOS machine. You also have Python 2.7 installed, it probably comes installed by default, you can get rid of it but I would advise against it. If it comes by default with your OS some applications may relay on it being there so removing it would break them. Also having many Python version installed is fine and sometimes needed so don't worry about it.

You have already defined python as an alias of python3, so you can say it is set as default:

reilly@Reillys-MacBook-Pro ~ % python --version
Python 3.10.4

You can now launch PyCharm and create new project, during this process you will be prompted to select which python interpreter version you would like to use. If python3 isn't selected/detected by default just add it manually (just paste the path to it /usr/bin/python3).

You will also be asked to choose between Previously configured interpreter and New environment using.... If you want to have "clean" python installation you should use latter (venv), this way you can have all your dependencies defined for every project separate and not polluting global installation. You can read more in docs or in this answer.

If this doesn't resolve your problems with pycharm you probably want to add some screenshots or error messages from it to your question.

Grekkq
  • 679
  • 6
  • 14