Databytes

Daily bytes of learning

19 Mar 2023

Local Python Environment Refresh

Local Python Environment Refresh Series

For years, I’ve been a conda user. My first introduction to Python was thru the now defunct Enthought Canopy distribution circa 2013/14. At that time in 2013, Anaconda was nascient. As a beginner, there was more widely available directions on how to install and use Enthought’s distribution.

After a brief personal and professional foray into R in 2014, I came back to find a considerably more mature Anaconda distribution. The crux of joy for Anaconda users of that period was pre-packaged ML and scientific packages that all played nicely together. You needed to spend less time fiddling with installs by using Anaconda. For those that worked on multiple projects, conda environments provided a tidy way to manage multiple development environments.

Managing multiple environments on single machine with Anaconda was always easy, but once you introduced multiple machines, the problems started. Simply, the portability of conda environments was never as easy as one wanted. To make life easier, one team I worked on in 2016, went so far as to create Docker containers and expose a remote Jupyter kernel. We each had our own local Jupyter setup, and we connected to a “remote” kernel running inside a Docker image on our individual machines. We could more easily manage the versions and consistency of our environment this way.

Over time, I’ve come to more deeply appreciate the handmade simplicity of a requirements.txt over a conda_env.yml. I have undoubtedly been influenced by the open-source community. They have shunned conda as a package manager instead favoring more modern, comprehensive and stable systems such as Poetry and pipenv.

Series Objective

I am not deeply familiar with either Poetry or Pipenv. The goal of this series is to document my experiences setting up a workflow for a sample TensorFlow project with both environments. This blog is a learning journal not a tutorial site. I’ll be writing down what I’m trying, why I’m doing something, and what I don’t understand. Don’t expect perfect grammar tidy explanations or perfect understanding. If you’re reading this, you are up for a journey.

Resources