安装后 python 3.7.2 usr/bin 只有 python 2.7
After installing python 3.7.2 usr/bin has only python 2.7
我是 python 的新手,我刚刚安装了 python 3.7.2,至少我的 IDLE 是这样告诉我的。但是,当我检查 usr/bin 时,我只看到 python2.7。这是为什么?怎么回事?
提前致谢!
P.S.: 这是第一次也是唯一一次 python 我的机器看到了,我很确定。
系统:IOS v.10.13.6
现在,MAC OS X 预装了 python2
,他们可以通过放置它来使用它在 /usr/local/bin
中并且此位置已经在 System PATH.
中
如果您安装 Python3+ 之类的任何新版本,它将安装在 /Library/Frameworks/Python.framework/Versions/<version>/bin/
上。
例如在我的例子中,完整路径是 /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
& /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
。
我已经使用 Homebrew.
安装了 Python3.6
以下是我的终端的有用日志。请看一下。
» Versions check with path (which python)
Rishikeshs-MacBook-Air:~ hygull$ which python
/usr/local/bin/python
Rishikeshs-MacBook-Air:~ hygull$
which python3
Rishikeshs-MacBook-Air:~ hygull$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Rishikeshs-MacBook-Air:~ hygull$
which python3.6
Rishikeshs-MacBook-Air:~ hygull$ which python3.6
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
Rishikeshs-MacBook-Air:~ hygull$
» Start & exit (python2, default installation on MAC OS X)
python
Rishikeshs-MacBook-Air:~ hygull$ python
Python 2.7.15 (default, Jan 12 2019, 21:07:57)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> exit()
Rishikeshs-MacBook-Air:~ hygull$
python3
Rishikeshs-MacBook-Air:~ hygull$ python3
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> exit()
Rishikeshs-MacBook-Air:~ hygull$
python3.6
(Same as above but useful if you have two python3+, e.g. if you have python3.6 & python3.7 installed & you want to work with python3.6)
Rishikeshs-MacBook-Air:~ hygull$ python3.6
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
我是 python 的新手,我刚刚安装了 python 3.7.2,至少我的 IDLE 是这样告诉我的。但是,当我检查 usr/bin 时,我只看到 python2.7。这是为什么?怎么回事?
提前致谢!
P.S.: 这是第一次也是唯一一次 python 我的机器看到了,我很确定。
系统:IOS v.10.13.6
现在,MAC OS X 预装了 python2
,他们可以通过放置它来使用它在 /usr/local/bin
中并且此位置已经在 System PATH.
如果您安装 Python3+ 之类的任何新版本,它将安装在 /Library/Frameworks/Python.framework/Versions/<version>/bin/
上。
例如在我的例子中,完整路径是 /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
& /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
。
我已经使用 Homebrew.
安装了 Python3.6以下是我的终端的有用日志。请看一下。
» Versions check with path (which python)
Rishikeshs-MacBook-Air:~ hygull$ which python
/usr/local/bin/python
Rishikeshs-MacBook-Air:~ hygull$
which python3
Rishikeshs-MacBook-Air:~ hygull$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Rishikeshs-MacBook-Air:~ hygull$
which python3.6
Rishikeshs-MacBook-Air:~ hygull$ which python3.6
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
Rishikeshs-MacBook-Air:~ hygull$
» Start & exit (python2, default installation on MAC OS X)
python
Rishikeshs-MacBook-Air:~ hygull$ python
Python 2.7.15 (default, Jan 12 2019, 21:07:57)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> exit()
Rishikeshs-MacBook-Air:~ hygull$
python3
Rishikeshs-MacBook-Air:~ hygull$ python3
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> exit()
Rishikeshs-MacBook-Air:~ hygull$
python3.6
(Same as above but useful if you have two python3+, e.g. if you have python3.6 & python3.7 installed & you want to work with python3.6)
Rishikeshs-MacBook-Air:~ hygull$ python3.6
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>