How to setup an (almost) unbreakable Python development environment?

<p>I&rsquo;ve been developing stuff for quite a while now and a good part of it was built using Python (on a Mac).<br /> More often than not, I get to help a friend or coworker to unf*** their Python environment because it &ldquo;broke&rdquo; somehow&nbsp;<br /> Here is the setup I&lsquo;ve been using on macOS for quite long now and that is basically &ldquo;unbreakable&rdquo;.</p> <h1>TLDR;</h1> <ul> <li>Don&rsquo;t touch builtin system Python</li> <li>Install Python versions with&nbsp;Homebrew&nbsp;for dependencies only</li> <li>Use&nbsp;asdf&nbsp;to install and switch between usable Python versions</li> <li>Install CLI (Python) packages with&nbsp;pipx&nbsp;(e.g. ipython, pipenv, black, &hellip;)</li> <li>At the project level,&nbsp;<em>at least</em>&nbsp;use&nbsp;<code>venv</code>&nbsp;but I recommend tools such as&nbsp;Pipenv&nbsp;or&nbsp;poetry</li> </ul> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:630/1*yThDlOniu2ZEQ1Je_j27Sg.png" style="height:700px; width:700px" /></p> <h1>Layer 0</h1> <p>macOS comes with Python installed, versions will differ depending on the version of macOS.&nbsp;<strong>Don&rsquo;t even touch it with a stick</strong>. The goal for us with this layer is just to leave this install as pristine as it can be. Don&rsquo;t try to update it, don&rsquo;t try to install packages. Just leave it there for the system and everything will be fine.</p> <p><a href="https://medium.com/@wnkz/how-to-setup-an-almost-unbreakable-python-development-environment-f9bb6fde9810">Click Here</a></p>