Hello, 
while I've been doing one of my snap on Python I faced with need to use 3rd 
party Python package available via pip.
I just did:
PYTHONUSERBASE=/path/to/snap/root python3.4 -m pip install <package> --user 
world
and it downloaded package and all dependency right into snap root dir. But be 
careful with python version.
Then I wrote small bash script for starting my python script on snappy:

#!/bin/bash
export PYTHONUSERBASE=$(realpath $(dirname $0)/../)
$PYTHONUSERBASE/bin/myscript.py

That's it. Snap works perfectly.

________________________________________
От: [email protected] 
<[email protected]> от имени Alexander Sack 
<[email protected]>
Отправлено: 10 апреля 2015 г. 0:36
Кому: Dustin Kirkland
Копия: Jamie Strandboge; Snappy Devel
Тема: Re: Python snaps

On Thu, Apr 9, 2015 at 9:21 PM, Dustin Kirkland <[email protected]> wrote:
>
> On Apr 3, 2015 3:15 PM, "Jamie Strandboge" <[email protected]> wrote:
>>
>> On 04/03/2015 01:32 PM, Dustin Kirkland wrote:
>> > On Thu, Apr 2, 2015 at 5:46 PM, Barry Warsaw <[email protected]> wrote:
>> >> I've been doing some work to see what's involved in deploying Python
>> >> snaps.  I
>> >> have some interesting results that I've blogged about.
>> >>
>> >> http://www.wefearchange.org/2015/04/creating-python-snaps.html
>> >>
>> >> No doubt there's plenty of room for improvement, but I think it also
>> >> shows
>> >> that the basic tools are there for some level of support for Python on
>> >> Ubuntu
>> >> Core.
>> >
>> > Hey Barry!  Fantastic to seeing this move forward.
>> >
>> > I'm quite interested in getting a snap of a pet python project of mine
>> > into a snap -- ssh-import-id.  The upstream source is at
>> > lp:ssh-import-id, but I maintain a git mirror at
>> > https://github.com/dustinkirkland/ssh-import-id.
>> >
>> I know this is mostly about packaging a python program but I'd feel remiss
>> if I
>> didn't mention that ssh-import-id isn't going to work properly under
>> confinement
>> since it won't be able to access ~/.ssh. This tool likely should be
>> included as
>> part of comfy.
>
> Well that's a bummer, and not entirely expected...
>
> Is there a comprehensive guide or wiki page or even just a running list of
> all the age old, taken for granted UNIX/LINUX expectations that are
> different in Snappy's brave new world?
>
> Perhaps a Snappy-ified FHS?

https://developer.ubuntu.com/en/snappy/guides/filesystem-layout/

The "Snap packages" section in there has some of that. We should
update that to add more details for release.


>
>> --
>> Jamie Strandboge                 http://www.ubuntu.com/
>>
>>
>> --
>> snappy-devel mailing list
>> [email protected]
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/snappy-devel
>>
>
>
> --
> snappy-devel mailing list
> [email protected]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snappy-devel
>

--
snappy-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snappy-devel
-- 
snappy-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snappy-devel

Reply via email to