Possible bug: broken python apps (incl. OpenDroneMap, and Fakecam) on core20

I assist with maintaining the OpenDroneMap snap here:


I’ve filed a bug report on the core20 tracker, and was recommended to report here:


Our users have been reporting (infrequently, but consistently) an issue with our snap:

snap run opendronemap
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.executable = '/usr/bin/python3'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f2e195c7740 (most recent call first):
<no Python frame>

I was able to reproduce it under WSL2 as well as 20.04LTS in Hyper-V.

In speaking with Dani, they indicated that they have seen similar breakage even with their own snaps and they recommended that we downgrade our core to core18 and then adjust the stage-packages to reflect this.

Our snapcraft yaml(s):


User threads (other reports/reproductions):


Does anyone have any further guidance on this, or ways that I can collect more information if this is a confirmed bug?


I’ve found this with any Python app in a Core20-based Snap using the gnome-3-38 extension - it is impacting my ability to migrate fakecam to core20. I haven’t tried to narrow down whether this is ALL Core20-based python apps or whether the use of the gnome extension is important - I believe ODM doesn’t use the extension, but I might be misremembering.

It seems that Snapcraft isn’t installing any python dependencies resulting in the encodings module to be missing, among a whole slew of others:

  • python3: Pre-Depends: python3-minimal
  • python3-minimal: Pre-Depends: python3.8-minimal
  • python3.8-minimal:
    Pre-Depends: libc6 (>= 2.29)
    Depends: libpython3.8-minimal (= 3.8.10-0ubuntu1~20.04.2), libexpat1 (>= 2.1~beta3), zlib1g (>= 1:1.2.0)
  • libpython3.8-minimal: this is the missing package providing the encodings module.

Explicitly including python3 as a stage-packages entry does not install the dependencies, so I would suggest the dependency parser/resolver is broken.

cc: @sergiusens

@Saijin_Naib, I’ve amended the topic title to include Fakecam in the list of broken snaps to illustrate that it’s affecting multiple Snaps.

1 Like

As a workaround, I tried adding the following to stage-packages to install all the missing python3 packages that are skipped when attempting to stage python3:

      - libpython3.8-minimal
      - libpython3.8-stdlib
      - python3
      - python3-minimal
      - python3.8-minimal

However, this caused fakecam to not be installed into the Snap by the python plugin at all. There are no fakecam files in my snap when adding these stage-packages, so this is not a fix.

1 Like