It appears this may involve a non-standard python installation: Python 3.9 is not in the archives for Bionic of Focal AFAIK. And python3.9 is installed in /usr/local/bin which is not the normal installation location. It is the location that python is installed when building from source and running `make altinstall`.
I was able to reproduce this issue by building python3.9 from source on bionic and installing with `make altinstall`. By default it doesn't appear that /usr/lib/python3/dist-packages is added to the python path.
So the quick fix is hopefully to just set PYTHONPATH=/usr/lib/python3/dist-packages. To test, try running
PYTHONPATH=/usr/lib/python3/dist-packages python3
and then try to `import uaclient` in the python shell.
There may be a way for us to handle this situation in the ubuntu-advantage-tools package as well.
Hi I noticed something and thought to chime in.
It appears this may involve a non-standard python installation: Python 3.9 is not in the archives for Bionic of Focal AFAIK. And python3.9 is installed in /usr/local/bin which is not the normal installation location. It is the location that python is installed when building from source and running `make altinstall`.
I was able to reproduce this issue by building python3.9 from source on bionic and installing with `make altinstall`. By default it doesn't appear that /usr/lib/ python3/ dist-packages is added to the python path.
So the quick fix is hopefully to just set PYTHONPATH= /usr/lib/ python3/ dist-packages. To test, try running /usr/lib/ python3/ dist-packages python3
PYTHONPATH=
and then try to `import uaclient` in the python shell.
There may be a way for us to handle this situation in the ubuntu- advantage- tools package as well.