Useful things in python's platform module
Contents
Useful things in python’s platform
module
Recently I was helping a colleague try and debug a failing installation of GeoPandas. Or to be more precise, installing Pyogrio, the default IO engine was failing. Now once upon a time this was regularly a pain point due to the lack of widely available windows wheels but today that’s a mostly solved problem. User error seemed a more likely scenario.
Pretty quickly I was able to work out that the issue came pypi trying to install via source, and the absence of a C compiler and the required flags to build GDAL was the error being surfaced. But why was pip installing a source distribution? We eventually tried downloading the wheel and installing that directly, and found out the platform was incompatible.
The hunch then was that they’d installed 32 bit python. But I struggled to find an easy way to prove that.
Now this week, looking for something else entirely I stumbled across platform.architecture()
which is exactly what I needed.
the platform module also has a few other useful goodies. Here are some examples on windows:
|
|
And on the version of WSL I have sitting around
|
|
Author Matt Richards
LastMod February 9, 2025 (50f2ab1)