Here I am again, trying to run multiple Pythons, with multiple libraries, without them tripping over each other. Many hackers have gone down this path and become lost, I expect I will fare no better, but I've stumbled upon a scheme which works for me, whether running Python on a Macintosh, in a Linux server, or even on Windows.
I've already blogged about Python 3 and Minecraft, but there are some subtle things which I glossed over in that post. I found when following my own notes that some of the steps are easy to skim over. I could explain a bit better what is going on, and why I was seeing weird errors when I resurrected my environment to work on an experiment with my kids.
UPDATE 2020-04-16 This is not how you should do it
These instructions and tools are great if you're going to use Python 2 and Virtualenv. But Python 2 is dead, and there are better ways to do this in Python 3. I'm still exploring the best ways, but I am leaning towards using pyenv + pyenv-virtualenv (or python venvs, or maybe pipenv?). Pyenv takes inspiration from rbenv which is how Ruby does this, so if you know Ruby then you'll understand it. When I understand better, I'll write another blog post
A while ago I noted that I should write about my shell functions for creating and managing Python Virtual Environments. Recently I was helping my boss set up some python virtual environments for some different projects, and I couldn't remember how to use virtualenv directly.
I really wanted to just share my wrappers with him, and I found that they weren't quite ready to share because I hadn't finished documenting them.
This post is to remedy that.
Tonight I finally converted all the Glossary pages in my mirror of the Jargon File into Unicode (utf-8 encoding) so that they will transmit and display properly from GitHub Pages (or any other modern web server). It was a fairly trivial thing to do in the end, but I am likely to need to repeat this for other things at work, so I'm blogging it.
The Jargon File was converted into XML-Dockbook and Unicode for version 4.4.0, but ESR only converted the front- and back-matter, not the Glossary entries (i.e. the actual lexicon). Those are still latin-1 (ISO-8859-1). And although the HTML rendition begins with the correct header declaring this:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
I've been having good natured arguments at work about whether it's the End of the World that we are at last switching away from Scientific Linux 6 and it's System V style init scripts, to CentOS 7, which uses systemd.
My own opinion is that systemd is pretty cuspy. It's not perfect, but nor is it some great hulking monolithic monster come to destroy the Unix Way in the Linux world. It offers many worthwhile improvements and I've enjoyed using it in openSUSE for years now. I look forward to switching away from the hair-ball of wet SysV init scripts with clumsy precedent semantics and manual service recovery.
Now, I don't want to throw my hat into the ring on the pro's and con's of systemd having replaced the start-up infrastructure (and a lot of other systems besides) on Linux-based operating systems. Enough has been said already on that front, by many more experienced than I, and further argument is pointless: whichever camp you're in, you won't be convinced of the other sides point of view by now.
However there is one argument against systemd that I'm not so sure about: journald and it's past issues:
- alleged buffering of logs, making diagnostics and debugging on time-critical services difficult or impossible
- binary log files which can be corrupted, and then not useful thereafter (because they're binary)
- volatile storage, so that your logs are gone when you want them the most: after an unplanned reboot
I'll be spending a few days experimenting with
journald in these areas, to see if it's as bad now as it was five years ago when concerns like these were being raised.
In this post I want to look at the
journald daemon /
journalctl log viewer a bit, from the point of view of buffering output, whether and where it could be occurring, and what the implications might be as a web sysop.
This is a medium-long post, with about 23 minutes of terminal output recordings (in text, using asciinema) and is about 2⅓MB to download. It's also about half-an-hour's read on top of that.
Some breif notes from a lazy Sunday morning spent exploring the minecraft coding environment that I set up using Raspberry Jam earlier. I'm taking my notes in Jupyter while I explore the Minecraft API and poke around with one of the sample programs. Since my blogging engine Nikola also supports Jupyter Notebooks as one of it's import formats, I found that I could do Litterate Programming for Minecraft quite nicely!
A summary of the steps to install Minecraft with Forge, the two Forge mods "Raspberry Jam Mod" and "PythonTool Mod" and configure the coding environment to my preferred arrangement. I am using this on my own computers (work's Mac, and my openSUSE PCs) as well as my son's Windows 10 PC.
A bit over two years ago I wrote a post about hacking minecraft with Python. During my holiday break this year I decided to revisit this, and have a bit more of a go with it. Some things have changed, including the Minecraft Bukkit Server that I used then (CanaryMod) being abandoned, and some new enhanced modules that let you run Minecraft PI Python code on a non-PI machine, with Python 3! So let's dig in.
I'm having a play with Minecraft and Python, using the mcpipy library, a Minecraft server called CannaryMod, and a plugin-in for that called RaspberryJuice.
You can do all this out-of-the-box with Raspbian on a RaspberryPi, but I wanted to set up my home computers also. Here's a quick run-down of the steps I followed.
I recently had occasion to play with some Python at work (a small script to do some configurations, and I didn't want to do them in bash), so I took the time to get all of this set up. It's all so very easy and not worth writing about. However I thought that the interactive debugger (which is awesome, btw) has a small issue that needs resolving. Mean-time, here's a work-around.