![]() With Homebrew, you don’t need a complicated path pointing to the Python framework. Set Up the EnvironmentĪny previous Python installs may have cluttered up your PATH environment variable. Remove versions of Python in the Python framework: $ sudo rm -Rf /Library/Frameworks/amework/Versions/* Step 3. Remove all the symbolic links in /usr/local/bin that point to Python related files: $ sudo rm /usr/local/bin/python* $ sudo rm /usr/local/bin/pip* When I switched to Homebrew Python, I wanted to get rid of all the extra Python installs. On my system, I had installed Python various times from DMG installers on. Get Rid of the Old PythonsĬareful!! Some applications include a version of Python and, as mentioned above, macOS relies on Python. If Python had been installed by Homebrew, it’s location would start with. This tells us that we have Python 3.4 installed and it was not installed using Homebrew because the location is. /./Library/Frameworks/amework/Versions/3.4/bin/python Try this command to see where you’re at: $ ls -l /usr/local/bin/python* lrwxr-xr-x 1 root wheel 68 Jul 5 10:05 /usr/local/bin/python ->. However, Python located in, or symbolically linked from, /usr/local/bin is not part of the macOS and can be deleted. You cannot do much to this version - and don’t try or you’ll mess up your Mac. But, be careful! On a Mac, the operating system needs the version of Python kept at /usr/bin/python. If you want a squeaky-clean system, you can remove extraneous Python installs. It’s how it’s installed and updated that differs. If you downloaded Python directly from and used the installer, you’ll have non-Homebrew Python on your system. Do you already have non-Homebrew Python installed? ![]() If you have a need for several legacy versions of Python, skip this step. If all went well, you should now be able to check the Homebrew version: $ brew -version Homebrew 2.2.14 Homebrew/homebrew-core (git revision 118be0 last commit ) Homebrew/homebrew-cask (git revision 656ce last commit ) Step 2. When Xcode finishes, this command will install Homebrew: $ ruby -e "$(curl -fsSL )" This will probably ask for your password and may take awhile depending on whether you already have any Xcode components installed already. Installing Homebrewįirst, we’ll install a bit of Apple’s Xcode, which Homebrew requires, and then Homebrew. If you don’t see something like that and instead Bash says -bash: brew: command not found, then you need to install Homebrew. ![]() Open a terminal and find out whether it is installed by checking the version: $ brew -version Homebrew 2.2.14 Homebrew/homebrew-core (git revision 118be0 last commit ) Homebrew/homebrew-cask (git revision 656ce last commit ) Since we’re using Homebrew, or brew, to keep Python up-to-date, it needs to be installed. We’ll need to see where you’re starting from in order to get setup correctly. If you’re setting up your Mac from scratch, my article Zero to Hero: Set Up Your Mac for Software Development will guide you through the whole process. However, if you require nuanced versioning or multiple versions of Python, check out my article on pyenv: Multiple version Python development on Mac. This is a good one-size-fits-all solution. Yes, you can trust the old references, as written! That guidance is still valid.NOTE: In this opinionated story, I suggest that the “right” way of doing Python 3 on macOS is to have the latest version and to stay current with frequent updating. ![]() All done.Īt no time did I touch the python installation located within the /System folder. Reinstall python and python3 via homebrew. So, brew prune (or brew cleanup -prune in newer versions of Homebrew) worked perfectly. I initially renamed the ones that were obviously going to cause me trouble.
0 Comments
Leave a Reply. |