Import python package installed with snap

Hi, newb question incoming. I would like to do something like this:

$ sudo snap install PythonPackage
$ python3
>>> import PythonPackage

Is this possible with snaps? This would be helpful for python packages that are complicated to install.

1 Like

I’m necrobumping this (Sorry I do this a lot, I guess I’m a necromancer) because I now have the same (or similar) question: I need to use a python package in my Ubuntu Core 18 build. How do I go about installing and using it? Can I snap it?

you either include it in your application snap … or if you have multiple app snaps and the python packge is really really huge, you could create a content snap with this python packag included and have all your app snaps connect to its content interface (normally it isnt worth the effort and simply adding your snap to stage-packages of your apps is the easier path)

Gotcha. I’ll have to check with the security team and see what all needs access to this library.

Also, I found this topic, which I guess is related: Snap including a pip package