installing the resulting snap on bionic shows the error:
root@b:~# test-22-on-bionic
Traceback (most recent call last):
File "/snap/test-22-on-bionic/x2/script", line 3, in <module>
import ssl
File "/usr/lib/python3.10/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: /usr/lib/python3.10/lib-dynload/_ssl.cpython-310-x86_64-linux-gnu.so: failed to map segment from shared object
So, this seems to be a snapd/core22 issue.
The issue can be seen by installing a core22-based snap on bionic, then getting a shell with snap run --shell and running `python -c 'import ssl'`
It can be reproduced with a very simple snap like:
--- snapcraft.yaml
name: test-22-on-bionic
version: '1.0'
summary: test snap
description: test snap
confinement: strict
grade: stable
base: core22
apps: 22-on-bionic:
test-
command: script
parts:
local:
plugin: dump
source: .
stage:
- script
--- script
#!/usr/bin/env python3
import ssl
installing the resulting snap on bionic shows the error:
root@b:~# test-22-on-bionic test-22- on-bionic/ x2/script" , line 3, in <module> python3. 10/ssl. py", line 98, in <module> python3. 10/lib- dynload/ _ssl.cpython- 310-x86_ 64-linux- gnu.so: failed to map segment from shared object
Traceback (most recent call last):
File "/snap/
import ssl
File "/usr/lib/
import _ssl # if we can't import it, let the error propagate
ImportError: /usr/lib/