Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75020 > unrolled thread

Is it possible to install Python on a network?

Started byroys2005@gmail.com
First post2014-07-22 13:49 -0700
Last post2014-07-23 16:17 +1000
Articles 16 — 7 participants

Back to article view | Back to comp.lang.python


Contents

  Is it possible to install Python on a network? roys2005@gmail.com - 2014-07-22 13:49 -0700
    Re: Is it possible to install Python on a network? emile <emile@fenx.com> - 2014-07-22 14:08 -0700
    Re: Is it possible to install Python on a network? roys2005 <roys2005@gmail.com> - 2014-07-22 17:41 -0700
      Re: Is it possible to install Python on a network? Dan Stromberg <drsalists@gmail.com> - 2014-07-22 20:51 -0700
        Re: Is it possible to install Python on a network? roys2005 <roys2005@gmail.com> - 2014-07-23 07:15 -0700
          Re: Is it possible to install Python on a network? Chris Angelico <rosuav@gmail.com> - 2014-07-24 01:46 +1000
          Re: Is it possible to install Python on a network? Ned Deily <nad@acm.org> - 2014-07-23 16:47 -0700
          Re: Is it possible to install Python on a network? Dan Stromberg <drsalists@gmail.com> - 2014-07-23 20:40 -0700
      Re: Is it possible to install Python on a network? Ben Finney <ben+python@benfinney.id.au> - 2014-07-23 14:18 +1000
        Re: Is it possible to install Python on a network? roys2005 <roys2005@gmail.com> - 2014-07-23 07:24 -0700
          Re: Is it possible to install Python on a network? Chris Angelico <rosuav@gmail.com> - 2014-07-24 01:56 +1000
          Re: Is it possible to install Python on a network? Ben Finney <ben+python@benfinney.id.au> - 2014-07-24 12:35 +1000
          Re: Is it possible to install Python on a network? Chris Angelico <rosuav@gmail.com> - 2014-07-24 12:42 +1000
          Re: Is it possible to install Python on a network? Ben Finney <ben+python@benfinney.id.au> - 2014-07-24 12:48 +1000
          Re: Is it possible to install Python on a network? Chris Angelico <rosuav@gmail.com> - 2014-07-24 12:52 +1000
      Re: Is it possible to install Python on a network? Chris Angelico <rosuav@gmail.com> - 2014-07-23 16:17 +1000

#75020 — Is it possible to install Python on a network?

Fromroys2005@gmail.com
Date2014-07-22 13:49 -0700
SubjectIs it possible to install Python on a network?
Message-ID<e84ec19b-f441-4c4b-ac63-1e2f7b893f8f@googlegroups.com>
We are using Python in a large setup. Individual users are running Debian machines. When I want to install/upgrade Python for all users, I really want to
do it centrally rather than every user having to upgrade on their own.

Many software packages are installed this way. However, I could not figure out
any way to do this with Python.

How can I do this?

Thank you.

Koushik Roy

[toc] | [next] | [standalone]


#75023

Fromemile <emile@fenx.com>
Date2014-07-22 14:08 -0700
Message-ID<mailman.12195.1406063311.18130.python-list@python.org>
In reply to#75020
On 07/22/2014 01:49 PM, roys2005@gmail.com wrote:
>
> We are using Python in a large setup. Individual users are running Debian machines. When I want to install/upgrade Python for all users, I really want to
> do it centrally rather than every user having to upgrade on their own.
>
> Many software packages are installed this way. However, I could not figure out
> any way to do this with Python.
>
> How can I do this?


This is more a sysadmin than python issue.  And, debian itself has 
python dependencies, so you need to be careful you don't break it.

That said, we use a similar setup and have an aptitude repository with 
approved software that holds the approved source packages users can 
install.  Combining automated user system updating with a sole 
repository where only your versions are available should do it.

Emile


[toc] | [prev] | [next] | [standalone]


#75043

Fromroys2005 <roys2005@gmail.com>
Date2014-07-22 17:41 -0700
Message-ID<2d7d457c-2030-43d0-94a6-6ceb93eb4d7c@googlegroups.com>
In reply to#75020
Emile, thanks for the quick response.

Does this mean Python cannot be or should not be installed at a central location?
If so, what is the root cause for this?

- Koushik

[toc] | [prev] | [next] | [standalone]


#75051

FromDan Stromberg <drsalists@gmail.com>
Date2014-07-22 20:51 -0700
Message-ID<mailman.12213.1406087474.18130.python-list@python.org>
In reply to#75043
On Tue, Jul 22, 2014 at 5:41 PM, roys2005 <roys2005@gmail.com> wrote:
>
> Emile, thanks for the quick response.
>
> Does this mean Python cannot be or should not be installed at a central location?
> If so, what is the root cause for this?

Back when I was a sysadmin, I would install CPython to a few different
NFS filesystems for hundreds of machines to use (more than one
filesystem because we had about 5 *ix variants - you probably only
need 1). It's just a matter of "./configure --prefix=/where/ever &&
make && make install" once you have the build dependencies.

It worked fine, but if you symlink you get into trouble because Python
can't find it's default module path where it expects; symlinking can
require a wrapper that sets an environment variable - I believe it was
$PYTHONPATH.

Perhaps it would be appropriate to ask: Why are you wondering if it works?

[toc] | [prev] | [next] | [standalone]


#75088

Fromroys2005 <roys2005@gmail.com>
Date2014-07-23 07:15 -0700
Message-ID<875ce0f0-c6a8-4b50-b97f-d11ee543ef05@googlegroups.com>
In reply to#75051
Dan,

  Thanks for the information. So, one option is to build Python
  from source code to be able to install "/where/ever/..."

  I still wonder why there is no distribution package for *ix that
  contains binaries/libraries that can be installed "/where/ever/..."

  Or, may be there is - I just don't know - but I want to know.

- Koushik



On Tuesday, July 22, 2014 11:51:06 PM UTC-4, Dan Stromberg wrote:
> 
> Back when I was a sysadmin, I would install CPython to a few different
> 
> NFS filesystems for hundreds of machines to use (more than one
> 
> filesystem because we had about 5 *ix variants - you probably only
> 
> need 1). It's just a matter of "./configure --prefix=/where/ever &&
> 
> make && make install" once you have the build dependencies.
> 
> 
> 
> It worked fine, but if you symlink you get into trouble because Python
> 
> can't find it's default module path where it expects; symlinking can
> 
> require a wrapper that sets an environment variable - I believe it was
> 
> $PYTHONPATH.
> 
> 
> 
> Perhaps it would be appropriate to ask: Why are you wondering if it works?

[toc] | [prev] | [next] | [standalone]


#75091

FromChris Angelico <rosuav@gmail.com>
Date2014-07-24 01:46 +1000
Message-ID<mailman.12244.1406130421.18130.python-list@python.org>
In reply to#75088
On Thu, Jul 24, 2014 at 12:15 AM, roys2005 <roys2005@gmail.com> wrote:
>   Thanks for the information. So, one option is to build Python
>   from source code to be able to install "/where/ever/..."
>
>   I still wonder why there is no distribution package for *ix that
>   contains binaries/libraries that can be installed "/where/ever/..."

There probably isn't, because there's no need to. Distro packages on
Linux are generally designed to play nicely with the rest of the
packages in the repository, rather than handle every possible
configuration change you might want to do; if you want full
flexibility, it's usually pretty easy to just grab the source and
build (this is distinctly different from Windows, where it's assumed
that most people don't know how to build from source, and Mac OS,
where you have to actively jump through hoops just to get a C
compiler).

On a Debian-derived system, you should be able to use "sudo apt-get
build-dep python" (or python3) to get the libraries etc you need, and
then either "apt-get source python" or "hg clone
http://hg.python.org/cpython" to get the source (the former will get
you the source for the system Python, the latter will get you the
absolute latest source code for all branches - you might have to pick
which branch to use, rather than using 'default'). On Red Hat systems,
I'm sure there's an equally easy way to gather the build dependencies,
and it'll probably be in 'man yum'.

ChrisA

[toc] | [prev] | [next] | [standalone]


#75103

FromNed Deily <nad@acm.org>
Date2014-07-23 16:47 -0700
Message-ID<mailman.12252.1406159254.18130.python-list@python.org>
In reply to#75088
In article <875ce0f0-c6a8-4b50-b97f-d11ee543ef05@googlegroups.com>,
 roys2005 <roys2005@gmail.com> wrote:
>   I still wonder why there is no distribution package for *ix that
>   contains binaries/libraries that can be installed "/where/ever/..."

One issue is that the Python build process on **ix captures the 
configured install path names into the built files in various places, 
like in _sysconfigdata.py.  So, in general, it is currently not 
supported to install a vanilla Python build into a location other than 
the path specified on the original configure commmand (default = 
/usr/local), e.g.

    ./configure --prefix=/path/to
    make
    make install

As long as you are producing a package that will be installed into the 
same path on each system and each system has a compatible architecture, 
you should be OK.

-- 
 Ned Deily,
 nad@acm.org

[toc] | [prev] | [next] | [standalone]


#75119

FromDan Stromberg <drsalists@gmail.com>
Date2014-07-23 20:40 -0700
Message-ID<mailman.12263.1406173250.18130.python-list@python.org>
In reply to#75088
On Wed, Jul 23, 2014 at 7:15 AM, roys2005 <roys2005@gmail.com> wrote:
>
> Dan,
>
>   Thanks for the information. So, one option is to build Python
>   from source code to be able to install "/where/ever/..."
>
>   I still wonder why there is no distribution package for *ix that
>   contains binaries/libraries that can be installed "/where/ever/..."

In theory, you could change all the various autoconf'd tools to get
their "prefix" from an environment variable, but right now, they
pretty much all want to get their prefix at compile time.  Some only
use it to know where to install, but CPython is one of many that looks
for ancillary files under "prefix".

[toc] | [prev] | [next] | [standalone]


#75052

FromBen Finney <ben+python@benfinney.id.au>
Date2014-07-23 14:18 +1000
Message-ID<mailman.12214.1406089114.18130.python-list@python.org>
In reply to#75043
roys2005 <roys2005@gmail.com> writes:

> Does this mean Python cannot be or should not be installed at a
> central location?

Can you explain better what you mean by this?

As stated, it doesn't make much sense to me: Any machine which supports
running Python can be central or distributed, but it can only be invoked
on the same machine. What does it mean *to you* to say “install Python
on a network”?

Perhaps you're asking not so much about installing, but *running*
Python. I don't see how you can run a program “on a network” except by
running the program *on one specific machine* and having that program
*communicate* over a network. Is that what you mean?

If not, you're going to need to explain what you are asking more
precisely.

-- 
 \     “Books and opinions, no matter from whom they came, if they are |
  `\     in opposition to human rights, are nothing but dead letters.” |
_o__)                                                  —Ernestine Rose |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#75089

Fromroys2005 <roys2005@gmail.com>
Date2014-07-23 07:24 -0700
Message-ID<e5860f6d-f23a-4614-904d-7bbd5d96accd@googlegroups.com>
In reply to#75052
Ben,

  I am trying to find out how I can install Python on a central machine
  so that all users can use it, rather than using /usr/local/bin/python.
     ( I am talking about unix/linux platform )

  Since, I do not know the answer, I was asking if Python
  can/can't/should/shouldn't be installed on a central machine.

  Hope that clarifies.
  Thanks,

- Koushik

 


On Wednesday, July 23, 2014 12:18:18 AM UTC-4, Ben Finney wrote:
> 
> 
> 
> > Does this mean Python cannot be or should not be installed at a
> 
> > central location?
> 
> 
> 
> Can you explain better what you mean by this?
> 
> 
> 

[toc] | [prev] | [next] | [standalone]


#75093

FromChris Angelico <rosuav@gmail.com>
Date2014-07-24 01:56 +1000
Message-ID<mailman.12245.1406130981.18130.python-list@python.org>
In reply to#75089
On Thu, Jul 24, 2014 at 12:24 AM, roys2005 <roys2005@gmail.com> wrote:
>   I am trying to find out how I can install Python on a central machine
>   so that all users can use it, rather than using /usr/local/bin/python.
>      ( I am talking about unix/linux platform )
>
>   Since, I do not know the answer, I was asking if Python
>   can/can't/should/shouldn't be installed on a central machine.

Firstly, I would *strongly* recommend keeping /usr/bin/python (or
/usr/local/bin/python, whatever `which python` says) exactly where it
is. Call that one the "system Python", and treat it like bash, grep,
and all those other important tools. You'll only mess up your system
if you mess with that.

But with that sorted: I don't see any particular problem with mounting
some remote drive and running Python from it. You'll probably need to
make sure the path to it is the same as it was on the system that
installed it, and you'll definitely want to do this only on systems
with the same architecture, but otherwise you should be fine. Make
yourself a /usr/central/bin/python or something, install Python into
it, and then make /usr/central on all the others as a mount point for
/usr/central on the one where you installed it.

And then you can come back and tell us all how it went, because most
of us will have never tried it :)

ChrisA

[toc] | [prev] | [next] | [standalone]


#75113

FromBen Finney <ben+python@benfinney.id.au>
Date2014-07-24 12:35 +1000
Message-ID<mailman.12258.1406169344.18130.python-list@python.org>
In reply to#75089
roys2005 <roys2005@gmail.com> writes:

>   I am trying to find out how I can install Python on a central machine
>   so that all users can use it

That's what confuses me. How do you envisage this working? On a given
machine, you can *run* programs only on that machine.

If you want to run a program on a different machine, you must somehow
invoke it using a network service already configured to do that. What
service are you expecting to use? SSH? HTTP? There is nothing about a
programming language interpreter which pents a way to run programs
across a network, unless you can specify *how* that is to happen.

What do you imaging a user doing, exactly, on machine ‘foo’ to make a
program execute on machine ‘bar’? At what step – exactly how – does the
communication between the machines occur to invoke the program? How is
the user's input, and the program's output, communicated in a way that
machine ‘foo’ knows to interact with machine ‘bar’?

-- 
 \      “The opposite of a correct statement is a false statement. But |
  `\     the opposite of a profound truth may well be another profound |
_o__)                                              truth.” —Niels Bohr |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#75114

FromChris Angelico <rosuav@gmail.com>
Date2014-07-24 12:42 +1000
Message-ID<mailman.12259.1406169767.18130.python-list@python.org>
In reply to#75089
On Thu, Jul 24, 2014 at 12:35 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
> roys2005 <roys2005@gmail.com> writes:
>
>>   I am trying to find out how I can install Python on a central machine
>>   so that all users can use it
>
> That's what confuses me. How do you envisage this working? On a given
> machine, you can *run* programs only on that machine.
>
> If you want to run a program on a different machine, you must somehow
> invoke it using a network service already configured to do that. What
> service are you expecting to use? SSH? HTTP? There is nothing about a
> programming language interpreter which pents a way to run programs
> across a network, unless you can specify *how* that is to happen.
>
> What do you imaging a user doing, exactly, on machine ‘foo’ to make a
> program execute on machine ‘bar’? At what step – exactly how – does the
> communication between the machines occur to invoke the program? How is
> the user's input, and the program's output, communicated in a way that
> machine ‘foo’ knows to interact with machine ‘bar’?

Network mounts work fine for this kind of thing. I don't usually do it
with binaries, due to architecture and library incompatibilities, but
I have a directory that I mount on half a dozen systems, and part of
what it carries is a Python script. So in that sense, I do run that
program from one central machine, on all those other machines. I use
sshfs for the mounting, but other systems work too.

Of course, it is a dependency. In my case it's safe, because the
purpose of that Python script is bound up with the rest of what's
available (and which must be centralized; it's about a terabyte of
stuff, and I don't want to be constantly syncing it). It all depends
on how dangerous that is to you.

ChrisA

[toc] | [prev] | [next] | [standalone]


#75115

FromBen Finney <ben+python@benfinney.id.au>
Date2014-07-24 12:48 +1000
Message-ID<mailman.12260.1406170104.18130.python-list@python.org>
In reply to#75089
Chris Angelico <rosuav@gmail.com> writes:

> On Thu, Jul 24, 2014 at 12:35 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
> > What do you imaging a user doing, exactly, on machine ‘foo’ to make
> > a program execute on machine ‘bar’? At what step – exactly how –
> > does the communication between the machines occur to invoke the
> > program? How is the user's input, and the program's output,
> > communicated in a way that machine ‘foo’ knows to interact with
> > machine ‘bar’?
>
> Network mounts work fine for this kind of thing.

I'd rather not propose a solution until we know better what the problem
is; what “roys2005” expects the behaviour to be. So the questions above
need, IMO, answers from “roys2005”.

-- 
 \              “Whatever you do will be insignificant, but it is very |
  `\                    important that you do it.” —Mohandas K. Gandhi |
_o__)                                                                  |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#75116

FromChris Angelico <rosuav@gmail.com>
Date2014-07-24 12:52 +1000
Message-ID<mailman.12261.1406170352.18130.python-list@python.org>
In reply to#75089
On Thu, Jul 24, 2014 at 12:48 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
> Chris Angelico <rosuav@gmail.com> writes:
>
>> On Thu, Jul 24, 2014 at 12:35 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
>> > What do you imaging a user doing, exactly, on machine ‘foo’ to make
>> > a program execute on machine ‘bar’? At what step – exactly how –
>> > does the communication between the machines occur to invoke the
>> > program? How is the user's input, and the program's output,
>> > communicated in a way that machine ‘foo’ knows to interact with
>> > machine ‘bar’?
>>
>> Network mounts work fine for this kind of thing.
>
> I'd rather not propose a solution until we know better what the problem
> is; what “roys2005” expects the behaviour to be. So the questions above
> need, IMO, answers from “roys2005”.

Fair enough. Since he was talking earlier about upgrades, though, I
figured he was talking about having a single source of code, only one
place to update, and then initiate programs on the individual
computers. But yeah, need the OP's responses.

ChrisA

[toc] | [prev] | [next] | [standalone]


#75060

FromChris Angelico <rosuav@gmail.com>
Date2014-07-23 16:17 +1000
Message-ID<mailman.12219.1406096240.18130.python-list@python.org>
In reply to#75043
On Wed, Jul 23, 2014 at 2:18 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
> roys2005 <roys2005@gmail.com> writes:
>
>> Does this mean Python cannot be or should not be installed at a
>> central location?
>
> Can you explain better what you mean by this?
>
> As stated, it doesn't make much sense to me: Any machine which supports
> running Python can be central or distributed, but it can only be invoked
> on the same machine. What does it mean *to you* to say “install Python
> on a network”?

On one computer, install Python into /foo/bar/spam/python. On another
computer, mount firstcomputer:/foo/bar/spam as /foo/bar/spam. Run
Python the same way on both systems.

ChrisA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web