Escaping from Anaconda (Python)
paulromer.net
paulromer.net
I think that students' first real introduction to python should be through the command line, virtual environments and pip. This may hurt at first, but it'll probably be less painful than when you eventually hit a road block and have to learn how to transition away from Anaconda.
I concur
dumped it and never looked back
IMO, it's best to set them up on their work station with everything they need to get started then as the need arises start introducing more complex concepts such as deps management, version control, python versions etc.
I always worry that we over load students when we teach them coding. It can lead to feeling overwhelmed, thinking coding is not for them and never coming near it.
So uv is not the solution imo. Bare bones python with a basic repl editor for starting out.
This is my experience from being a helper and a trainer in the softwate carpentries workshops.
Fortunately Python already includes an basic editor in the standard distribution, IDLE. It is an underrated tool. I think one reason Ruby stalled and failed to overtake Python after an initial surge in the aughts was the lack of an similar tool leading to more attrition for beginners. See for example this 13 year-old stackoverflow question: https://stackoverflow.com/questions/3763140/idle-like-intera...
For a long time economics was dragging behind using matlab or specialized statistics software (ugh). Even using R was considered novel among econometricians for a while.
I mean, we dependency management in python is a complete mess. It's not something we can expect a mere Nobel winner to solve.
I think it supports enough stuff for things like "programming 101" or "learn Python by doing something simple with data."
Perhaps near the end of the course you can introduce the problems of grown-up Python, after the students have already mastered things like syntax and hierarchical structures.
That said, I'm not a huge fan of the approach described. It's leaning a bit too much on Wittgenstein's Ladder for my taste, but more importantly it's putting concepts out of order. The article seems to dismiss virtual environments as more complex, but they really aren't that bad - they're honestly easier to work with than the approach the author discovered organically, of creating "real" environments by repeatedly reinstalling Python and setting up dependencies from a requirements.txt file. This glosses over the hard part of populating the requirements.txt file, while also not building the necessary conceptual framework to understand dependency graphs (and thus lockfiles).
I was especially bothered by the fact that this advises blindly moving a file around using the GUI without trying to understand the purpose of that file, and describing what Anaconda does as "taking over the system". While I'm sure that works, if students are in the position described then they should learn fundamental developer skills first. I.e.:
> There is a lot to learn when you are getting started. Try out virtual environments later, when you are ready. If you do not know how to edit a file, run a command from the terminal, and have pip install libraries from a requirements.txt file, you are not ready.
It takes mere minutes to learn these skills, and they should have been taught way before exposing the student to anything that actually justifies setting up Anaconda. There are countless interesting projects for students that don't require third-party libraries at all, let alone the SciPy stack (and even that installs just fine with Pip nowadays anyway).
It's also indefensible, IMO, to say:
> python3.11 and python3.12 are examples of major versions.
> python3.12.4 and python3.12.5 are minor versions.
While I understand the impetus ("Python 3 is the brand now"), this is simply incorrect, and incompatible with how every relevant extant piece of documentation uses the terms (including for tools like Pip that will immediately become relevant to the student).
However, for python, it makes sense. A bunch of code breaks in 3.12 vs 3.11, for instance. Also, python 2 vs python 3 are very incompatible at this point, and it's been a split over a decade old.
This is why R actually really great btw, R/RStudio make it insanely easy to “just get going” with a package installer UI.
I had to run someone's 10 year old R workflow last week. Ran perfectly.
Last years python code will not run unless someone was careful enough to make a requirements.txt. Try explaining that to the non computer scientists. My python support colleague runs into that constantly. She is not a happy support person.
You are correct that the post misused the terms major version and minor version.
I'll fix it, and note the error and your catch, because
- I don't want to spread misinformation; and
- the right thing to do is to acknowledge the contributions that others make.