1. Python.org에서 download
2. Install
3. 설치확인
Launchpad에서
Terminal 에서
jangwonpark@JANGWONs-MacBook-Air ~ % which python3
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3
jangwonpark@JANGWONs-MacBook-Air ~ %
jangwonpark@JANGWONs-MacBook-Air ~ % cd /usr/local/bin
jangwonpark@JANGWONs-MacBook-Air bin % ls -al
total 40
drwxr-xr-x 23 root wheel 736 Dec 10 18:35 .
drwxr-xr-x 3 root wheel 96 Nov 13 17:44 ..
lrwxr-xr-x 1 root wheel 67 Dec 10 02:57 2to3 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/2to3
lrwxr-xr-x 1 root wheel 72 Dec 10 02:57 2to3-3.11 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/2to3-3.11
-rwxr-xr-x 1 root wheel 606 Nov 13 01:59 fuzzy_match
-rwxr-xr-x 1 root wheel 600 Nov 13 01:59 httpclient
lrwxr-xr-x 1 root wheel 68 Dec 10 02:57 idle3 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/idle3
lrwxr-xr-x 1 root wheel 71 Dec 10 02:57 idle3.11 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/idle3.11
lrwxrwxr-x 1 root admin 67 Dec 10 02:57 pip3 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/pip3
lrwxrwxr-x 1 root admin 70 Dec 10 02:57 pip3.11 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/pip3.11
-rwxr-xr-x 1 root wheel 582 Nov 13 01:59 pod
lrwxr-xr-x 1 root wheel 69 Dec 10 02:57 pydoc3 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/pydoc3
lrwxr-xr-x 1 root wheel 72 Dec 10 02:57 pydoc3.11 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/pydoc3.11
lrwxr-xr-x 1 root wheel 70 Dec 10 02:57 python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3
lrwxr-xr-x 1 root wheel 77 Dec 10 02:57 python3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3-config
lrwxr-xr-x 1 root wheel 78 Dec 10 02:57 python3-intel64 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3-intel64
lrwxr-xr-x 1 root wheel 73 Dec 10 02:57 python3.11 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11
lrwxr-xr-x 1 root wheel 80 Dec 10 02:57 python3.11-config -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11-config
lrwxr-xr-x 1 root wheel 81 Dec 10 02:57 python3.11-intel64 -> ../../../Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11-intel64
-rwxr-xr-x 1 root wheel 598 Nov 13 01:59 sandbox-pod
-rwxr-xr-x 1 root wheel 594 Nov 13 01:59 xcodeproj
jangwonpark@JANGWONs-MacBook-Air bin % su -
Password:
JANGWONs-MacBook-Air:~ root# ln -s python3 python
JANGWONs-MacBook-Air:~ root# ln -s pip3 pip
JANGWONs-MacBook-Air:~ root# python
Python 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import sys
>>> sys.executable
'/usr/local/bin/python'
JANGWONs-MacBook-Air:Applications root# cd /Applications/Python\ 3.11/
JANGWONs-MacBook-Air:Python 3.11 root# ls -al
total 1168
drwxr-xr-x@ 10 root wheel 320 Dec 10 02:57 .
drwxrwxr-x 18 root admin 576 Dec 10 02:57 ..
drwxr-xr-x 3 root wheel 96 Dec 10 02:57 IDLE.app
-rw-r--r--@ 1 root wheel 0 Dec 7 05:34 Icon?
-rwxr-xr-x 1 root wheel 1420 Dec 7 05:34 Install Certificates.command
-rw-r--r-- 1 root wheel 15122 Dec 7 05:34 License.rtf
lrwxr-xr-x 1 root wheel 99 Dec 10 02:57 Python Documentation.html -> /Library/Frameworks/Python.framework/Versions/3.11/Resources/English.lproj/Documentation/index.html
drwxr-xr-x 3 root wheel 96 Dec 10 02:57 Python Launcher.app
-rw-r--r-- 1 root wheel 3430 Dec 7 05:34 ReadMe.rtf
-rwxr-xr-x 1 root wheel 2972 Dec 7 05:34 Update Shell Profile.command
JANGWONs-MacBook-Air:Python 3.11 root#
JANGWONs-MacBook-Air:Frameworks root# cd /Library/Frameworks/Python.framework/
JANGWONs-MacBook-Air:Python.framework root# ls -al
total 0
drwxr-xr-x 6 root wheel 192 Dec 10 02:57 .
drwxr-xr-x 6 root wheel 192 Dec 10 02:57 ..
lrwxr-xr-x 1 root wheel 24 Dec 10 02:57 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 root wheel 23 Dec 10 02:57 Python -> Versions/Current/Python
lrwxr-xr-x 1 root wheel 26 Dec 10 02:57 Resources -> Versions/Current/Resources
drwxrwxr-x 4 root wheel 128 Dec 10 02:57 Versions
JANGWONs-MacBook-Air:Python.framework root# cd Versions/
JANGWONs-MacBook-Air:Versions root# ls -al
total 0
drwxrwxr-x 4 root wheel 128 Dec 10 02:57 .
drwxr-xr-x 6 root wheel 192 Dec 10 02:57 ..
drwxrwxr-x 11 root admin 352 Dec 10 02:57 3.11
lrwxr-xr-x 1 root wheel 4 Dec 10 02:57 Current -> 3.11
4. 확인해보니
/usr/bin/python3이 설치되어 있는데 이건 macOS 기본설치가 아닌 Xcode설치시 번들로 설치되는 버전이다.
JANGWONs-MacBook-Air:bin root# cd /usr/bin
JANGWONs-MacBook-Air:bin root# ls -al python3
-rwxr-xr-x 76 root wheel 167136 Oct 28 17:43 python3
JANGWONs-MacBook-Air:bin root#
JANGWONs-MacBook-Air:bin root# ./python3
Python 3.9.6 (default, Sep 26 2022, 11:37:49)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/Applications/Xcode.app/Contents/Developer/usr/bin/python3'
>>> exit()
JANGWONs-MacBook-Air bin % cd /Applications/Xcode.app/Contents/Developer/usr/bin/
JANGWONs-MacBook-Air bin % ls -al python3
lrwxr-xr-x 1 root wheel 67 Nov 13 01:37 python3 -> ../../Library/Frameworks/Python3.framework/Versions/3.9/bin/python3
JANGWONs-MacBook-Air bin % cd ../../Library/Frameworks/Python3.framework
JANGWONs-MacBook-Air Python3.framework % ls -al
total 0
drwxr-xr-x 6 root wheel 192 Nov 13 01:38 .
drwxr-xr-x 5 root wheel 160 Oct 22 22:42 ..
lrwxr-xr-x 1 root wheel 24 Nov 13 01:33 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 root wheel 24 Nov 13 01:33 Python3 -> Versions/Current/Python3
lrwxr-xr-x 1 root wheel 26 Nov 13 01:33 Resources -> Versions/Current/Resources
drwxr-xr-x 5 root wheel 160 Nov 13 01:38 Versions
JANGWONs-MacBook-Air Python3.framework % cd Versions
JANGWONs-MacBook-Air Versions % ls -al
total 0
drwxr-xr-x 5 root wheel 160 Nov 13 01:38 .
drwxr-xr-x 6 root wheel 192 Nov 13 01:38 ..
drwxr-xr-x 8 root wheel 256 Oct 22 22:53 3.8
drwxr-xr-x 10 root wheel 320 Oct 22 22:53 3.9
lrwxr-xr-x 1 root wheel 3 Nov 13 01:33 Current -> 3.9
5. Python Launcher의 경로도 변경해준다.
기존 : /usr/local/bin/python3 → /usr/local/bin/python