Python3.6 Snap

Hey all,

Building a snap for a project I’m working on and I need Python3.6 specifically. Is there any way to pull it in without having to do a full python build by hand? I’m just wondering if there is a solution for getting python versions beyond 2 vs 3. I normally wouldn’t have a problem but we were using some things in python3.6 to save time and porting it back seems like a waste if we don’t have to. So does anyone have any idea where to start?

EDIT: I guess it would be easier just to remove the 3.6 specific code and just use the default rather than over complicating it. If anyone has an answer it would be interesting though.

Hi Shane!

Great question.

If you can wait for the core-18 snap (based off Ubuntu 18.04 (bionic)) then that will give you Python 3.6 out of the box. Another option would be to use the deadsnakes ppa which contains backports of Python 3.6 to 16.04 (xenial).

Both would save you from building python from source, or modifying your code.

1 Like

Hey popey,

Long time no chat. I have the deadsnakes ppa on that but when I run snapcraft it pulls 3.5 in the bundle on 16.04. So would that mean if I pick python3.6 as the default python3 it would pull that instead? (I ported it in like an hour anyway so it wasn’t a massive job anyway but still it’s a good fyi for the future maybe)

Hey popey and all,

Follow up question for this thread, I see core18 snap is in the repo, how do I use that one instead of the core snap for snapcraft?

Were you able to use Python 3.6 using core18? If so, how? Do you have an example? Thanks.