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!

lulijeta
  • 900
  • 1
  • 9
  • 19
  • start from here: http://stackoverflow.com/questions/264290/how-to-discover-what-linux-distribution-is-in-use – furins Mar 15 '13 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. – Daniel Roseman Mar 15 '13 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. – mechanical_meat Mar 15 '13 at 16:02
  • paste output of uname -a you will be able to see what *nix flavor your a dealing with – jassinm Mar 15 '13 at 16:20
  • @DanielRoseman I remember installing it on my Ubuntu myself too. I think there are Linux distributions without Python – lulijeta Mar 15 '13 at 16:25
  • @bernie Sorry about the inconvenience, I am new to this forum as well. Why is that, the topic isn't relevant? Just so I don't repeat the mistake – lulijeta Mar 15 '13 at 16:27
  • No need to apologise. Judging by folk's responses this post falls in a gray area: it may or may not be considered off-topic depending on how you look at it. Either way, I'm glad you got your issue solved. Best of luck with your project. – mechanical_meat Mar 15 '13 at 16:42

1 Answers1

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)

Community
  • 1
  • 1
furins
  • 4,979
  • 1
  • 39
  • 57