简体   繁体   中英

python installation - what version I've installed (Mac installation)

I've installed python and while checking to see which version I've installed, it seems I have 2 versions installed

I was running this command

which -a python python3

then I got this result

/usr/bin/python
/usr/local/bin/python3
/usr/bin/python3

Is it correct? I was doing something wrong? I'm confused because also while running this command

python --version 

I'm getting

Python 2.7.16

It is correct. You have python 2 installed in your mac

You can try python3 --version to see python 3 version installed.

You could try:

import sys
print(sys.version)

in the python console. That way you could know for sure what version you are actually using

by default mac os comes up with python 2 preinstalled while you only need to install python 3

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM