2

I need to run a Python script on a remote Linux machine. The problem is that Python isn't installed on that machine. As a newbie in Linux greedily taking advantage of the user friendly tools Ubuntu offers, I have no clue how to install it without a packet manager (God bless apt-get!). I don't even know if the OS running on the remote machine is Debian based, but I do know that it doesn't have apt-get installed.

I connect to it using SSH, have root rights, want to run my scripts on it continuously.

Please help me! Thanks in advance!

7
  • start from here: stackoverflow.com/questions/264290/…
    – furins
    Mar 15, 2013 at 16:02
  • 1
    I find it hard to believe there's any Linux machines without some version of Python installed. It's integral to many system utilities. Mar 15, 2013 at 16:02
  • Just a guess: The machine might use the yum package manager. This post is slightly off-topic for this particular site, though. Mar 15, 2013 at 16:02
  • paste output of uname -a you will be able to see what *nix flavor your a dealing with
    – jassinm
    Mar 15, 2013 at 16:20
  • @DanielRoseman I remember installing it on my Ubuntu myself too. I think there are Linux distributions without Python
    – lulijeta
    Mar 15, 2013 at 16:25

1 Answer 1

9

as a normal user run the following commands:

wget http://www.python.org/ftp/python/2.7/Python-2.7.tgz
tar xzf Python-2.7.tgz
cd Python-2.7
./configure --with-pth --with-dec-threads --with-signal-module --prefix=/opt/python-2.7
make

then as root do (becoming root using sudo or su):

make install

A brief explanation:

  • wget downloads the python sources, you can install another version if you like, maybe python 3.x
  • tar uncompress the downloaded file
  • configure checks if all required dependances are available and configures the source code for your own system
  • make starts the compiling/linking process
  • make install copy the compiled file in the right place

after that maybe you need to make a symbolic link to your python executable or to your python folders, it depends on you

references: - the installations commands have been copy-pasted from this website after a rapid google search, so maybe you need different config options - the official info are here

note: I this question should be better placed on superuser.com (the reason is that may be more relevant for computer enthusiasts & power users rather than for programmers, since it is not a programming issue but a software installation issue)

Not the answer you're looking for? Browse other questions tagged or ask your own question.