Issues with Snapcraft inside a container


I tried the docker file from
to build snaps inside a container.

When I try to run the snapcraft with a build script it fails with below error

Traceback (most recent call last): |
File “/snap/snapcraft/current/bin/snapcraft”, line 6, in |
from pkg_resources import load_entry_point |
ImportError: No module named ‘pkg_resources’

Is there a workaround for this issue

How are you calling snapcraft? The proper way is /snap/bin/snapcraft

yes I am calling in shell script /snap/bin/snapcraft and I get this error.
If I go bash shell of the container and do manually “snapcraft” it works.
It doesn’t work when we call inside a shell script.

Are you using the image published on snapcore/snapcraft (dokerhub registry)?
Can you share the shell script?