|
1 |
| -# uninstall-python3 |
2 |
| -A Simple Shell Script to Uninstall Python 3 versions from Mac OS/X |
| 1 | +# Uninstall Python3 |
| 2 | + |
| 3 | +A simple shell script to Uninstall Python 3 versions from Mac OS/X. |
| 4 | + |
| 5 | +Of course we all want Python 3 everywhere - but sometimes we want to remove the older version and install |
| 6 | +the latest version - or just do a re-install from scratch. |
| 7 | + |
| 8 | +There is no need to check out this repositoy - just grab the `uninstall-python3.sh` file and download it |
| 9 | +somewhere. |
| 10 | + |
| 11 | +The script is designed to function as a dry run so you can see all that it will do. To run a dry run, do |
| 12 | + |
| 13 | + bash uninstall-python3.sh |
| 14 | + |
| 15 | +Examine the output - make sure that it is moving only the expected files. When you are convinced this will do what you expect run |
| 16 | + |
| 17 | + bash uninstall-python3.sh | sudo bash -v |
| 18 | + |
| 19 | + To verify the files are gone, you can re-run |
| 20 | + |
| 21 | + bash uninstall-python3.sh |
| 22 | + |
| 23 | + It should produce no output. |
| 24 | + |
| 25 | + And then you can happily re-install Python 3! |
| 26 | + |
| 27 | + # Sample Output |
| 28 | + |
| 29 | + Here is the output of a sample run with the dry run first and the actual run second. At the very |
| 30 | + end we re-run a dry run to make sure things are gone. |
| 31 | + |
| 32 | + $ bash uninstall-python3.sh |
| 33 | + rm '/usr/local/bin/2to3' |
| 34 | + rm '/usr/local/bin/2to3-3.6' |
| 35 | + rm '/usr/local/bin/easy_install-3.6' |
| 36 | + rm '/usr/local/bin/idle3' |
| 37 | + rm '/usr/local/bin/idle3.6' |
| 38 | + rm '/usr/local/bin/pip3' |
| 39 | + rm '/usr/local/bin/pip3.6' |
| 40 | + rm '/usr/local/bin/pydoc3' |
| 41 | + rm '/usr/local/bin/pydoc3.6' |
| 42 | + rm '/usr/local/bin/python3' |
| 43 | + rm '/usr/local/bin/python3-32' |
| 44 | + rm '/usr/local/bin/python3-config' |
| 45 | + rm '/usr/local/bin/python3.6' |
| 46 | + rm '/usr/local/bin/python3.6-32' |
| 47 | + rm '/usr/local/bin/python3.6-config' |
| 48 | + rm '/usr/local/bin/python3.6m' |
| 49 | + rm '/usr/local/bin/python3.6m-config' |
| 50 | + rm '/usr/local/bin/pyvenv' |
| 51 | + rm '/usr/local/bin/pyvenv-3.6' |
| 52 | + rm -rf '/Library/Frameworks/Python.framework/Versions/3.6' |
| 53 | + rm -rf '/Applications/Python 3.6' |
| 54 | + $ bash uninstall-python3.sh | sudo bash -v |
| 55 | + Password: |
| 56 | + rm '/usr/local/bin/2to3' |
| 57 | + rm '/usr/local/bin/2to3-3.6' |
| 58 | + rm '/usr/local/bin/easy_install-3.6' |
| 59 | + rm '/usr/local/bin/idle3' |
| 60 | + rm '/usr/local/bin/idle3.6' |
| 61 | + rm '/usr/local/bin/pip3' |
| 62 | + rm '/usr/local/bin/pip3.6' |
| 63 | + rm '/usr/local/bin/pydoc3' |
| 64 | + rm '/usr/local/bin/pydoc3.6' |
| 65 | + rm '/usr/local/bin/python3' |
| 66 | + rm '/usr/local/bin/python3-32' |
| 67 | + rm '/usr/local/bin/python3-config' |
| 68 | + rm '/usr/local/bin/python3.6' |
| 69 | + rm '/usr/local/bin/python3.6-32' |
| 70 | + rm '/usr/local/bin/python3.6-config' |
| 71 | + rm '/usr/local/bin/python3.6m' |
| 72 | + rm '/usr/local/bin/python3.6m-config' |
| 73 | + rm '/usr/local/bin/pyvenv' |
| 74 | + rm '/usr/local/bin/pyvenv-3.6' |
| 75 | + rm -rf '/Library/Frameworks/Python.framework/Versions/3.6' |
| 76 | + rm -rf '/Applications/Python 3.6' |
| 77 | + $ bash uninstall-python3.sh |
| 78 | + $ |
| 79 | + |
| 80 | +Happy re-installing! |
0 commit comments