Installing ubuntu-advantage-tools fails with Python module import not found

Bug #2137638 reported by Owen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-advantage-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

Installing results in:
Preconfiguring packages ...
Selecting previously unselected package ubuntu-advantage-tools.
(Reading database ... 694873 files and directories currently installed.)
Preparing to unpack .../ubuntu-advantage-tools_37.1ubuntu0~24.04_all.deb ...
Unpacking ubuntu-advantage-tools (37.1ubuntu0~24.04) ...
Setting up ubuntu-advantage-tools (37.1ubuntu0~24.04) ...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'uaclient.files'
Traceback (most recent call last):
  File "/usr/lib/ubuntu-advantage/migrate_user_config.py", line 17, in <module>
    from uaclient import defaults, messages
ImportError: cannot import name 'defaults' from 'uaclient' (/usr/local/lib/python3.12/dist-packages/uaclient/__init__.py)
dpkg: error processing package ubuntu-advantage-tools (--configure):
 installed ubuntu-advantage-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

> which python3
/usr/bin/python3

> python3 -c "import uaclient"

> sudo python3 -c "import uaclient"

> env PYTHONPATH=/usr/lib/python3/dist-packages python3 -c "import uaclient"

> sudo env PYTHONPATH=/usr/lib/python3/dist-packages python3 -c "import uaclient"

> ua version
Traceback (most recent call last):
  File "/usr/bin/ua", line 33, in <module>
    sys.exit(load_entry_point('ubuntu-pro-client==8001', 'console_scripts', 'ubuntu-advantage')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/ua", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'uaclient.cli'

> apt policy ubuntu-advantage-tools
ubuntu-advantage-tools:
  Installed: 37.1ubuntu0~24.04
  Candidate: 37.1ubuntu0~24.04
  Version table:
 *** 37.1ubuntu0~24.04 500
        500 http://gb.archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages
        500 http://gb.archive.ubuntu.com/ubuntu noble-updates/universe i386 Packages
        100 /var/lib/dpkg/status
     31.2.3 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu noble/universe i386 Packages
        500 http://gb.archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        500 http://gb.archive.ubuntu.com/ubuntu noble/universe i386 Packages

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: ubuntu-advantage-tools 37.1ubuntu0~24.04
ProcVersionSignature: Ubuntu 6.11.0-28.28~24.04.1-generic 6.11.11
Uname: Linux 6.11.0-28-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.30.0-0ubuntu4.4
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: KDE
Date: Wed Jan 7 12:18:24 2026
InstallationDate: Installed on 2024-12-13 (390 days ago)
InstallationMedia: Ubuntu 22.04.5 LTS "Jammy Jellyfish" - Release amd64 (20240911)
PackageArchitecture: all
SourcePackage: ubuntu-advantage-tools
UpgradeStatus: Upgraded to noble on 2024-12-16 (387 days ago)

Revision history for this message
Owen (osavill-z) wrote :
Revision history for this message
Owen (osavill-z) wrote :

There is no Python3-uaclient

> sudo apt install --reinstall python3-opcua
...
Reinstallation of python3-opcua is not possible, it cannot be downloaded.
...

> pip install opcua opcua-client
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
...

Revision history for this message
Owen (osavill-z) wrote :

> sudo pro attach
Traceback (most recent call last):
  File "/usr/bin/pro", line 33, in <module>
    sys.exit(load_entry_point('ubuntu-pro-client==8001', 'console_scripts', 'ubuntu-advantage')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/pro", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'uaclient.cli'

Revision history for this message
Owen (osavill-z) wrote :

dpkg -l | grep opcua
ii python-opcua-tools 0.98.11-1ubuntu1 all Pure Python OPC-UA Client and Server (tools)
ii python3-opcua 0.98.11-1ubuntu1 all Pure Python OPC-UA Client and Server (Python 3)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.