Tkinter missing from Python stdlib

I am trying to create a snap in Python which uses Tkinter. Tkinter comes with the standard library, as I can see under /usr/lib/python3.6/, but I noticed that it was missing from the stdlib in my particulary snap. (idlelib, which uses tkinter, is likewise not there) Is there a reason for this omission, and what can I do to resolve it? :slight_smile:

1 Like

I think I understand now, courtesy of this post. It seems that Tkinter is set aside from the others (due to being much larger?) on purpose. I have to include it as a stage-package.

With that said, his solution no longer seems to work for me:

  files: #to deal with problem finding init.tcl
    plugin: dump
    source: /usr/share/tcltk/
    organize:
        '*': ./usr/lib/ 

I get the following error message:

Failed to pull source: unable to determine source type of '/usr/share/tcltk'.   
Check that the URL is correct or consider specifying `source-type` for this part. See `snapcraft help sources` for more information.

Are absolute directories not allowed anymore? If not, what should my workaround be?

Ah, the solution can be found here. It’s mostly working smoothly, save for a segmentation fault when I create a button. I’ll raise an error for that elsewhere, however.