The command : $ pip install pyhdb installs it only for Python 2.x On my Raspberry Pi I have both Python 2 and 3. The example code works on Python 2 but does not work in Python 3. It says : "No module ...