본문 바로가기
Study/Python

[MAC] PKG로 설치한 Python 2.7 삭제하기

by Becoming a Hacker 2022. 11. 29.
반응형

삭제 방법

/System/Library 내 Apple에서 제공하는 Python을 삭제할 경우 운영 체제에 손상이 발생할 수 있으며, 아래의 방법은 Apple에서 제공하는 Python 2.7에는 영향을 주지 않은 방법입니다.

(다른 버전의 경우 버전을 뜻하는 2.7 문자열만 변경하여 사용하면 될 것 같습니다)

 

1. Python 2.7 Framework 제거

$ sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

 

2. Python 2.7 Directory 제거

 

$ sudo rm -rf "/Applications/Python 2.7"

 

3. /usr/local/bin 내 Python 2.7를 가르키는 심볼릭 링크 제거

$ cd /usr/local/bin/
$ ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | sudo xargs rm

 

Reference

 

How to uninstall Python 2.7 on a Mac OS X 10.6.4?

I want to completely remove Python 2.7 from my Mac OS X 10.6.4. I managed to remove the entry from the PATH variable by reverting my .bash_profile. But I also want to remove all directories, files,

stackoverflow.com

 

반응형

댓글