FAQ
Dear all,


I have my python scripts that use several python libraries such as h5py, pyside, numpy....


In Windows I have an installer that will install python locally on user machine and so my program gets access to this local python and runs successfully.


How can I do this in Linux ? ( I want to install python plus my program on the user machine.) I do not want to use the user?s python or to install python on the user?s machine on root.


Thanks in Advance for your help,

Search Discussions

  • Joel Goldstick at Sep 3, 2015 at 3:27 pm

    On Thu, Sep 3, 2015 at 10:32 AM, Heli Nix wrote:
    Dear all,

    I have my python scripts that use several python libraries such as h5py, pyside, numpy....

    In Windows I have an installer that will install python locally on user machine and so my program gets access to this local python and runs successfully.

    How can I do this in Linux ? ( I want to install python plus my program on the user machine.) I do not want to use the user?s python or to install python on the user?s machine on root.

    Thanks in Advance for your help,

    --
    https://mail.python.org/mailman/listinfo/python-list

    Look into virtualenv or virtualenvwrapper. It will let you load a
    local python engine along with local copies of the modules you need to
    run your application. Pip is the weapon of choice to load the
    libraries, or pip3 with python 3.x


    --
    Joel Goldstick
    http://joelgoldstick.com
  • Luca Menegotto at Sep 3, 2015 at 3:31 pm

    Il 03/09/2015 16:32, Heli Nix ha scritto:


    How can I do this in Linux ?

    As far as I know, in general a Linux distro comes with Python already
    installed.
    All you have to do is check if the installed version matches your needs.
    Tipically, you'll find Python 2.7; however, I know there are distros
    with Python3.x as default (Fedora?)


    --
    Ciao!
    Luca
  • Chris Angelico at Sep 3, 2015 at 3:39 pm

    On Fri, Sep 4, 2015 at 1:31 AM, Luca Menegotto wrote:
    Il 03/09/2015 16:32, Heli Nix ha scritto:
    How can I do this in Linux ?

    As far as I know, in general a Linux distro comes with Python already
    installed.
    All you have to do is check if the installed version matches your needs.
    Tipically, you'll find Python 2.7; however, I know there are distros with
    Python3.x as default (Fedora?)

    Also Ubuntu. If you want to work across multiple Linux distros, the
    easiest way is to tell people to install either "python2" or "python3"
    using their system package manager, and then use that.


    ChrisA
  • Nick Sarbicki at Sep 3, 2015 at 3:53 pm
    Is 3.x the default on ubuntu now? My 14.10 is still 2.7. Although it does
    have python3 installed.


    On Thu, 3 Sep 2015 16:40 Chris Angelico wrote:

    On Fri, Sep 4, 2015 at 1:31 AM, Luca Menegotto
    wrote:
    Il 03/09/2015 16:32, Heli Nix ha scritto:
    How can I do this in Linux ?

    As far as I know, in general a Linux distro comes with Python already
    installed.
    All you have to do is check if the installed version matches your needs.
    Tipically, you'll find Python 2.7; however, I know there are distros with
    Python3.x as default (Fedora?)
    Also Ubuntu. If you want to work across multiple Linux distros, the
    easiest way is to tell people to install either "python2" or "python3"
    using their system package manager, and then use that.

    ChrisA
    --
    https://mail.python.org/mailman/listinfo/python-list
    --
      - Nick
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20150903/c8c2740e/attachment.html>
  • Chris Angelico at Sep 3, 2015 at 3:55 pm

    On Fri, Sep 4, 2015 at 1:53 AM, Nick Sarbicki wrote:
    Is 3.x the default on ubuntu now? My 14.10 is still 2.7. Although it does
    have python3 installed.

    I'm not sure. I think I read somewhere that the newest Ubuntus would
    ship with python3 preinstalled, but python2 not (though of course it'd
    be just an apt-get away). Maybe I'm wrong, and that's still in the
    future, but certainly it's the intention.


    ChrisA
  • Brett Kugler at Sep 3, 2015 at 4:19 pm

    On Thu, Sep 3, 2015 at 10:39 AM, Chris Angelico wrote:


    On Fri, Sep 4, 2015 at 1:31 AM, Luca Menegotto
    wrote:
    Il 03/09/2015 16:32, Heli Nix ha scritto:
    How can I do this in Linux ?

    As far as I know, in general a Linux distro comes with Python already
    installed.
    All you have to do is check if the installed version matches your needs.
    Tipically, you'll find Python 2.7; however, I know there are distros with
    Python3.x as default (Fedora?)
    Also Ubuntu. If you want to work across multiple Linux distros, the
    easiest way is to tell people to install either "python2" or "python3"
    using their system package manager, and then use that.

    ChrisA
    --
    https://mail.python.org/mailman/listinfo/python-list

    You could also look into a more robust solution like placing your
    application environment into something like a Docker container. This would
    require your customer machine to be running Docker, but it makes
    deployments highly portable as the container will sit on top of just about
    any Linux flavor and can be entirely self contained.


    Brett
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20150903/d8e9bdaa/attachment.html>
  • Luca Menegotto at Sep 3, 2015 at 4:23 pm

    Il 03/09/2015 17:53, Nick Sarbicki ha scritto:
    Is 3.x the default on ubuntu now? My 14.10 is still 2.7. Although it
    does have python3 installed.

    I've checked my Ubuntu 15.04, and the default is 2.7.9.
    There is also Python3 (3.4.3), but sorry, I can't remember if I've
    manually installed it or not.


    --
    Ciao!
    Luca
  • Chris Angelico at Sep 3, 2015 at 4:49 pm

    On Fri, Sep 4, 2015 at 2:23 AM, Luca Menegotto wrote:
    Il 03/09/2015 17:53, Nick Sarbicki ha scritto:
    Is 3.x the default on ubuntu now? My 14.10 is still 2.7. Although it
    does have python3 installed.

    I've checked my Ubuntu 15.04, and the default is 2.7.9.
    There is also Python3 (3.4.3), but sorry, I can't remember if I've manually
    installed it or not.

    If you mean that typing "python" runs 2.7, then that's PEP 394 at
    work. For compatibility reasons, 'python' doesn't ever run Python 3.
    (At least, not any time soon.) The question is more: What comes
    installed on a fresh system? Anything can be dragged in as a
    dependency of some other package, but a normal Ubuntu desktop
    installation won't depend on Python 2 for anything. Or at least,
    that's the plan; I don't know whether it's been accomplished yet or
    not.


    ChrisA
  • Luca Menegotto at Sep 3, 2015 at 5:29 pm

    Il 03/09/2015 18:49, Chris Angelico ha scritto:


    If you mean that typing "python" runs 2.7, then that's PEP 394 at
    work. For compatibility reasons, 'python' doesn't ever run Python 3.

    Please forgive me, Il make it clearer.
    I'm pretty shure that Ubuntu 15.04 comes with Python 2.7.
    I don't remember if Python 3 was preinstalled or if I had to install it
    manually.


    --
    Ciao!
    Luca
  • Chris Angelico at Sep 3, 2015 at 5:33 pm

    On Fri, Sep 4, 2015 at 3:29 AM, Luca Menegotto wrote:
    Il 03/09/2015 18:49, Chris Angelico ha scritto:
    If you mean that typing "python" runs 2.7, then that's PEP 394 at
    work. For compatibility reasons, 'python' doesn't ever run Python 3.

    Please forgive me, Il make it clearer.
    I'm pretty shure that Ubuntu 15.04 comes with Python 2.7.
    I don't remember if Python 3 was preinstalled or if I had to install it
    manually.

    Okay. I don't run any current Ubuntu anywhere, so I don't know. And I
    can't even find back the page now where the plans were being
    discussed; best I can find is this, about a year out of date now:


    https://wiki.ubuntu.com/Python/3


    ChrisA
  • Nick Sarbicki at Sep 3, 2015 at 5:40 pm
    I run ubuntu everywhere at home and python3 has come preinstalled since at
    least ubuntu 12.10.


    This article kind of covers it: https://wiki.ubuntu.com/Python


    Looks like they're suggesting that it's not been fully transitioned
    although definitely moving that way.


    On Thu, 3 Sep 2015 18:34 Chris Angelico wrote:

    On Fri, Sep 4, 2015 at 3:29 AM, Luca Menegotto
    wrote:
    Il 03/09/2015 18:49, Chris Angelico ha scritto:
    If you mean that typing "python" runs 2.7, then that's PEP 394 at
    work. For compatibility reasons, 'python' doesn't ever run Python 3.

    Please forgive me, Il make it clearer.
    I'm pretty shure that Ubuntu 15.04 comes with Python 2.7.
    I don't remember if Python 3 was preinstalled or if I had to install it
    manually.
    Okay. I don't run any current Ubuntu anywhere, so I don't know. And I
    can't even find back the page now where the plans were being
    discussed; best I can find is this, about a year out of date now:

    https://wiki.ubuntu.com/Python/3

    ChrisA
    --
    https://mail.python.org/mailman/listinfo/python-list
    --
      - Nick
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20150903/0c85847e/attachment.html>
  • Laura Creighton at Sep 3, 2015 at 10:26 pm

    In a message of Thu, 03 Sep 2015 07:32:55 -0700, Heli Nix writes:
    Dear all,

    I have my python scripts that use several python libraries such as h5py, pyside, numpy....

    In Windows I have an installer that will install python locally on user machine and so my program gets access to this local python and runs successfully.

    How can I do this in Linux ? ( I want to install python plus my program on the user machine.) I do not want to use the user?s python or to install python on the user?s machine on root.

    Thanks in Advance for your help,

    There are several approaches here. One is to get your users to
    run things in a virtualenv.


    see:https://virtualenv.pypa.io/en/latest/
    and
    https://virtualenvwrapper.readthedocs.org/en/latest/


    This works really well, but you have to have users who are
    capable of setting up a virtualenv in the first place.
    You will still run into problems of 'my shared library is
    different from your shared library'.


    YOu can also use PyInstaller (which you may have used to make
    windows binaries) to make linux ones. I've never done this, only
    made windows ones -- but that is what it says on the label.
    https://github.com/pyinstaller/pyinstaller/wiki


    I think you will still have to have a set of different files to
    download for different linux distributions, but I could be wrong
    about that.


    And if that problem is unacceptable, then you need docker.
    https://www.docker.com/


    I've just started playing with it, and I think it is really neat,
    but it is too soon for me to have any clue what the problems/tradeoffs
    are with it.


    Laura
  • Christian Gollwitzer at Sep 4, 2015 at 5:43 am

    Am 03.09.15 um 16:32 schrieb Heli Nix:
    I have my python scripts that use several python libraries such as
    h5py, pyside, numpy....

    In Windows I have an installer that will install python locally on
    user machine and so my program gets access to this local python and
    runs successfully.

    How can I do this in Linux ? ( I want to install python plus my
    program on the user machine.) I do not want to use the user?s python
    or to install python on the user?s machine on root.

    Another variant is the use of pyinstaller. It can generate a single
    directory with a copy of Python and all needed libraries. You can copy
    that to a different machine, and often it works - unless libc or some
    very basic library is different. Beware that this pulls in half of your
    system, so you'll end up with ~100 MB.


      Christian
  • Grant Edwards at Sep 4, 2015 at 1:16 pm

    On 2015-09-04, Christian Gollwitzer wrote:
    Am 03.09.15 um 16:32 schrieb Heli Nix:
    I have my python scripts that use several python libraries such as
    h5py, pyside, numpy....

    In Windows I have an installer that will install python locally on
    user machine and so my program gets access to this local python and
    runs successfully.

    How can I do this in Linux ? ( I want to install python plus my
    program on the user machine.) I do not want to use the user?s python
    or to install python on the user?s machine on root.
    Another variant is the use of pyinstaller. It can generate a single
    directory with a copy of Python and all needed libraries. You can copy
    that to a different machine, and often it works - unless libc or some
    very basic library is different. Beware that this pulls in half of your
    system, so you'll end up with ~100 MB.

    As an end-user of a number of largish Python applications on Linux, I
    don't think any of them use anything like pyinstaller (and I would not
    be very happy if they did -- I've likely got almost all of the
    required libraries already installed, and I don't need another copy of
    all that stuff on my machine that then has to be backed up).


    The normal way to distribute even large Python apps with a lot of
    required libraries is either as just the Python sources with a
    'setup.py' file or as a package that tells the system what
    dependancies and libraries are required. If you don't want to ship
    bare sources, the "right" way to distribute a Python app for Linux is
    as an .rpm, .ebuild, or .deb.


    --
    Grant Edwards grant.b.edwards Yow! An Italian is COMBING
                                       at his hair in suburban DES
                                   gmail.com MOINES!

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 3, '15 at 2:32p
activeSep 4, '15 at 1:16p
posts15
users9
websitepython.org

People

Translate

site design / logo © 2019 Grokbase