Installing Python on New Mac

As per this great video (on maintaining local python environments using pyenv), the Python that comes built into the Mac is for the Mac to use, not for programmers to use!

Moreover, sudo should be unnecessary when working with installing modules, etc. for python. This magic is achievable by doing the following:

  • Install Homebrew (this is the only step that requires sudo)
  • Use brew to install pyenv
  • Use pyenv to install the version(s) of python you want
  • Install pip to install any necessary python modules.

Install Homebrew

curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

The install will prompt a couple of PATH modifications you need to make

Install pyenv and python and make necessary PATH modifications for your shell.

brew install pyenv
pyenv install 3.12.0
pyenv global 3.12.0

install pip

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py

That should be good to go. You can type ‘pyenv versions’ to sanity check your work.

Posted

in

Current Spins

Top Albums

Check out my album Set It All Down on your favorite streaming service.


Posts Worth Reading:


Letterboxd


Reading Notes

  • Who profits from our constant state of dissatisfaction? The answer, of course, is painfully obvious. Every industry that sells a solution to a problem you […]
  • the shifts have been in place for awhile. A certain kind of book—say those reviewed in the NYRB—will become like opera, or theater, or ballet, […]
  • • No more struggle: “Whatever arises, train again and again in seeing it for what it is. The innermost essence of mind is without bias. […]
  • The real problem, in my mind, isn’t in the nature of this particular Venture-Capital operation. Because the whole raison-d’etre of Venture Capital is to make […]
  • . The EU invokes a mechanism called the precautionary principle in cases where an innovation, such as GMOs, has not yet been sufficiently researched for […]

Saved Links