It's useful to make a distinction between the Osmium Tool (a command-line application) and the Osmium Library. The latter is what you use to access OSM data in your own code, and it comes in various flavours for different programming languages – such as pyosmium for Python.
Converting .osm.pbf to .osm uses only built-in functionality of Osmium and does not involve writing your own code, so you can achieve it by calling the command-line tool with the appropriate parameters:
osmium cat luxembourg-latest.osm.pbf -o luxembourg-latest.osm
For your module error, it may be better to ask a separate question. But one thing to check is that you're using the correct version of python – simply calling python3 instead of python may make a difference depending on your system.