How to setup an (almost) unbreakable Python development environment?
<p>I’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 “broke” somehow <br />
Here is the setup I‘ve been using on macOS for quite long now and that is basically “unbreakable”.</p>
<h1>TLDR;</h1>
<ul>
<li>Don’t touch builtin system Python</li>
<li>Install Python versions with Homebrew for dependencies only</li>
<li>Use asdf to install and switch between usable Python versions</li>
<li>Install CLI (Python) packages with pipx (e.g. ipython, pipenv, black, …)</li>
<li>At the project level, <em>at least</em> use <code>venv</code> but I recommend tools such as Pipenv or 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. <strong>Don’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’t try to update it, don’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>