PLAY PODCASTS
Launching Python, Virtual Environments, and Locking Dependencies With Brett Cannon
Episode 93

Launching Python, Virtual Environments, and Locking Dependencies With Brett Cannon

The Real Python Podcast · Real Python

January 14, 202250m 42s

Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

<p>Would you like a simple command to launch your Python programs using the newest version of the language installed on your machine? This week on the show, we continue our conversation with Brett Cannon. Brett discusses his project, the Python Launcher for Unix.</p> <p>We dive into Brett&rsquo;s workflow to set up projects, virtual environments, and prepare for distribution. He shares some of the tools he employs and reasons for keeping things simple. </p> <p>We also talk about PEP 665, which specifies a file format to list an application&rsquo;s Python package installation requirements. Brett shares why he co-authored the PEP and a bit of the community&rsquo;s reaction. It leads to a deeper conversation about going beyond &lsquo;requirements.txt&rsquo; to lock files.</p> <div class="alert alert-primary" role="alert"> <p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/data-viz-with-dash/">Data Visualization Interfaces in Python With Dash</a> </p> <p>In this course, you&rsquo;ll learn how to build a dashboard using Python and Dash. Dash is a framework for building data visualization interfaces. It helps data scientists build fully interactive web applications quickly.</p> </div> <p>Topics:</p> <ul> <li>00:00:00 &ndash; Introduction</li> <li>00:01:43 &ndash; Python Launcher for Unix</li> <li>00:09:36 &ndash; Hiding a virtual environment directory</li> <li>00:13:30 &ndash; Sponsor: Scout APM</li> <li>00:14:17 &ndash; Environment managers and being an editor vs an IDE person</li> <li>00:17:32 &ndash; PEP 665, lock files, and Brett&rsquo;s dependency workflow</li> <li>00:20:56 &ndash; The hurdles of source distributions and version control repositories</li> <li>00:25:07 &ndash; Drawbacks of requirements files and standardizing lock files</li> <li>00:28:19 &ndash; Why PEP 665 is controversial and the changes to setuptools</li> <li>00:33:48 &ndash; Video Course Spotlight</li> <li>00:35:16 &ndash; Are these examples of growing pains?</li> <li>00:37:51 &ndash; Unfair comparisons to packaging in Rust or other languages</li> <li>00:42:35 &ndash; What are you excited about in the world of Python?</li> <li>00:43:54 &ndash; What do you want to learn next?</li> <li>00:49:23 &ndash; Thanks and goodbye</li> </ul> <p>Show Links:</p> <ul> <li><a href="https://snarky.ca/introducing-the-python-launcher-for-unix/">Introducing the Python Launcher for Unix</a></li> <li><a href="https://github.com/brettcannon/python-launcher">brettcannon/python-launcher: Python launcher for Unix</a></li> <li><a href="https://marketplace.visualstudio.com/items?itemName=ms-python.python">Python Extension for VSCode</a></li> <li><a href="https://flit.readthedocs.io/en/latest/rationale.html">Why use Flit? — Flit 3.5.1 documentation</a></li> <li><a href="https://github.com/jazzband/pip-tools/">pip-tools: A set of tools to keep your pinned Python dependencies fresh.</a></li> <li><a href="https://www.python.org/dev/peps/pep-0665/">PEP 665 &ndash; A file format to list Python dependencies for reproducibility of an application | Python.org</a></li> <li><a href="https://docs.python.org/3/library/venv.html">venv — Creation of virtual environments — Python 3.10.1 documentation</a></li> <li><a href="https://pypi.org/project/virtualenvwrapper/">virtualenvwrapper · PyPI</a></li> <li><a href="https://pypi.org/project/pdm/">pdm - Python Development Master · PyPI</a></li> <li><a href="https://pypi.org/project/pyflow/">pyflow - Streamlines working with Python projects and files · PyPI</a></li> <li><a href="https://pypi.org/project/pipenv/">pipenv · PyPI</a></li> <li><a href="https://snarky.ca/thoughts-on-a-tooling-workflow/">Thoughts on where tools fit into a workflow</a></li> <li><a href="https://snarky.ca/what-to-do-when-you-botch-a-release-on-pypi/">What to do when you botch a release on PyPI</a></li> <li><a href="https://realpython.com/python-virtual-environments-a-primer/">Python Virtual Environments: A Primer – Real Python</a></li> <li><a href="https://blog.ganssle.io/tag/setuptools.html#summary">Why you shouldn&rsquo;t invoke setup.py directly | Paul Ganssle</a></li> <li><a href="https://github.com/ethanhs/python-wasm">python-wasm: Build scripts and configuration for building CPython for Emscripten</a></li> <li><a href="https://pyodide.org/en/stable/">Pyodide — A Python distribution for the browser and Node.js based on WebAssembly</a></li> <li><a href="https://webassembly.org/">WebAssembly</a></li> <li><a href="https://www.oreilly.com/library/view/programming-rust-2nd/9781492052586/">Programming Rust, 2nd Edition</a></li> <li><a href="https://twitter.com/brettsky/status/1481069172314550276">Brett Cannon on Twitter: &ldquo;PEP 665 got rejected today 😞&rdquo;</a></li> </ul> <p>Level up your Python skills with our expert-led courses:</p> <ul> <li><a href="https://realpython.com/courses/what-is-pip/">A Beginner&#x27;s Guide to pip</a></li> <li><a href="https://realpython.com/courses/data-viz-with-dash/">Data Visualization Interfaces in Python With Dash</a></li> <li><a href="https://realpython.com/courses/working-with-pipenv/">Working With Pipenv</a></li> </ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast &amp; join our community of Pythonistas</a></p>