I have a mac, when I do:
python --version
I got:
Python 2.7.6
but when I got to:
/System/Library/Frameworks/Python.framework/Versions/3.3
where is 2.7.6 located ? any advice what should I do?
UPDATE:
$ which -a python python3
/usr/bin/python
/usr/local/bin/python3
$ brew list python python3
Error: No such keg: /usr/local/Cellar/python
$ locate python
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
in PyCharm editor, the default settings interpreter shows:
Use below command to see all python installations :
which -a python
If you have both Python2 and Python3 installed on your Mac, you can use
python --version
to check the version of Python2, and
python3 --version
to check the version of Python3.
However, if only Python3 is installed, then your system might use python
instead of python3
for Python3. In this case, you can just use
python --version
to check the version of Python3.
Use the which command
. It will show you the path
which python
To check third version, we can use,
python3 --version
Take a look at the docs regarding Python on Mac.
The version at /System/Library/Frameworks/Python.framework is installed by Apple and is used by the system. It is version 3.3 in your case. You can access and use this Python interpreter, but you shouldn't try to remove it, and it may not be the one that comes up when you type "Python" in a terminal or click on an icon to launch it.
You must have installed another version of Python (2.7) on your own at some point, and now that is the one that is launched by default.
As other answers have pointed out, you can use the command which python
on your terminal to find the path to this other installation.
Source: Stackoverflow.com