ModuleNotFoundError: No module named 'distutils.spawn'

running in sudo sdwdate in whonix workstation stable version giving me this reading:

user@host:~$ sudo sdwdate
Traceback (most recent call last):
  File "/usr/bin/sdwdate", line 23, in <module>
    from sdwdate.timesanitycheck import timesanitycheck
  File "/usr/lib/python3/dist-packages/sdwdate/timesanitycheck.py", line 9, in <module>
    from stem.connection import connect
  File "/usr/lib/python3/dist-packages/stem/connection.py", line 134, in <module>
    import stem.control
  File "/usr/lib/python3/dist-packages/stem/control.py", line 260, in <module>
    import stem.descriptor.microdescriptor
  File "/usr/lib/python3/dist-packages/stem/descriptor/__init__.py", line 51, in <module>
    import stem.util.system
  File "/usr/lib/python3/dist-packages/stem/util/system.py", line 52, in <module>
    import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
user@host:~$

I have reinstalled sdwdate but same issue. (Whonix testing version doesnt has this issue)

1 Like

Could you please try if this helps?

sudo apt-get install python3-distutils
1 Like
user@host:~$ sudo apt-get install python3-distutils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python3-distutils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libpython3.7-stdlib

E: Package 'python3-distutils' has no installation candidate

i tried setting up python3-distutils-extra but the same thing.

1 Like

Did you mix with Debian testing / buster? Installed any packages from Debian testing / buster?

Did you upgrade Whonix to Debian testing / buster package sources?

1 Like

Please try this one to make sure all dependencies are installed.

sudo apt-get install qubes-whonix-workstation
1 Like

i have installed qtox from debian buster then closed the repo, does that count?

Yes.

1 Like

yes all there.

1 Like

Install Additional Software Safely quote:

Before completing steps in this section, first read Prefer Packages from Debian Stable Repository.

Mixing packages from Debian stable with those from a later release like testing can destabilize the system due to associated software dependencies required for full functionality. First carefully check how packages will change before proceeding – a host of upgrades is usually safe, but no Whonix packages should be removed as part of the process, see Whonix Debian Packages. It is recommended to complete this process in a separate Whonix-Workstation ( whonix-ws-14-debian-testing-mix ) due to the risks. Ask for advice in the forums on a case-by-case basis.

This is such an instability.

Some dependencies were upgraded/changed that sdwdate depends on. You’d need libpython3.7-stdlib and/or python3-distutils from Debian buster as well. This may or may not work due to eventual other dependency issues.

All these issues may or may not be issues once Whonix gets ported to Debian buster either by upgrade or downloading a fresh build TemplateVM. (Probably both will be supported as always - too early to tell.)

To fix you likely need to revert your template changes.

Qubes, learn more:

qvm-revert-template-changes

Or reinstall the TemplateVM.

Install Additional Software Safely may also be an alternative.

2 Likes