

See the link destination with $ ls -l /opt/local/bin/python*. Either homebrew or port versions are in /opt/local/bin/.But if it contains anaconda in the path – it's Anaconda distribution. Anaconda distribution is by default located in /Users/your_user/anaconda3/, but of course you may put in the other place.It is located in /Library/Frameworks/amework/Versions/. Something downloaded from the official site.What are the other versions which you may have? So you can safely remove all the other versions. Note that for OSX 10.9 (and for everything at least until 10.13) this is the python2, not python3. The native python is that one, which is in the /System/Library/Frameworks/amework/Versions/2.7/bin/. You will see several links to different places. You can see which is which in /usr/bin with this command: Ctrl+D works too, as a shortcut.It's normal to have many python binaries. It was because of the reasons I explained above.Ī little bit of extra info, to properly exit the python interpreter command line, you can type exit() or quit(). I was thinking maybe it's due to me downloading python again when it was already installed, if it even was? So it is as if you run python and entering the codes you wrote inside hello.py into the python interpreter. What python hello.py does (if you were to run it in your terminal instead) is to execute the python interpreter, supplying your hello.py file as the code for the interpreter to interpret and execute. I suspect when you are running the command python hello.py, you were still inside the python interpreter program, which is why it return the InvalidSyntax error, because it is not a valid python syntax. However, all I keep getting is : Synta圎rror: Invalid Syntax Which was supposed to return: Hello World Then, it said to type in: python hello.py That is actually the python interpreter's command line. So instead of something like ~/Path/to/your/exercise/filesĪt the start of the line, you would have encountered the below instead: # Bunch of text describing your python version and other things If you notice, the command-line interface would have changed quite a bit (I am on Windows so I am not sure how it looks like exactly on Mac). In the case of running python, what it does is actually to load a python interpreter inside your terminal.

If it only has a command-line interface (like python) the program will be executed inside the terminal. What happens when you type a program name into terminal is that it basically executes the program, and if it has a GUI, the GUI window will pop up onto the screen. First, the lesson said to simply type, python, into terminal to start coding in python (I don't know if this is the way to say that, or if that just gives you the ability to run python code?)
