Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to install Python on Debian GNU/Linux (Python-2.7.2.tar.bz2)

Reply
Thread Tools

How to install Python on Debian GNU/Linux (Python-2.7.2.tar.bz2)

 
 
patrickwayodi
Guest
Posts: n/a
 
      12-05-2011
Hi,
How can I install Python on Debian GNU/Linux? I downloaded the file
"Python-2.7.2.tar.bz2" but I don't know how to install it.

Patrick.
 
Reply With Quote
 
 
 
 
Chris Angelico
Guest
Posts: n/a
 
      12-05-2011
On Tue, Dec 6, 2011 at 1:53 AM, patrickwayodi <(E-Mail Removed)> wrote:
> Hi,
> How can I install Python on Debian GNU/Linux? I downloaded the file
> "Python-2.7.2.tar.bz2" but I don't know how to install it.


You should actually already have Python installed. Try typing 'python'
at a terminal and see if it invokes the interactive interpreter.

ChrisA
 
Reply With Quote
 
 
 
 
patrickwayodi
Guest
Posts: n/a
 
      12-05-2011
> You should actually already have Python installed. Try typing 'python'
> at a terminal and see if it invokes the interactive interpreter.
>
> ChrisA



Yes, I have Python installed, but it's an old version. So I want to
upgrade to "Python-2.7.2.tar.bz2".

 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      12-05-2011
On Tue, Dec 6, 2011 at 2:40 AM, patrickwayodi <(E-Mail Removed)> wrote:
>> You should actually already have Python installed. Try typing 'python'
>> at a terminal and see if it invokes the interactive interpreter.
>>
>> ChrisA

>
>
> Yes, I have Python installed, but it's an old version. So I want to
> upgrade to "Python-2.7.2.tar.bz2".


Ah gotcha. I believe you can 'sudo apt-get install python2.7' - at
least, you can on the Ubuntu system next to me. Not sure though; I
build my Python from source straight from Mercurial.

What you have there, I think, is a source code snapshot. You'd need to
extract it and then do the usual incantation:
$ ./configure
$ make
$ sudo make install

If you don't have the compiler/build environment set up, you'll have
to do that first. If you aren't too concerned about the exact version
you get, the above apt-get line should get you a stable Python in the
2.7 branch.

ChrisA
 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      12-05-2011
On Tue, 06 Dec 2011 02:51:21 +1100, Chris Angelico wrote:

> On Tue, Dec 6, 2011 at 2:40 AM, patrickwayodi <(E-Mail Removed)>
> wrote:
>>> You should actually already have Python installed. Try typing 'python'
>>> at a terminal and see if it invokes the interactive interpreter.
>>>
>>> ChrisA

>>
>>
>> Yes, I have Python installed, but it's an old version. So I want to
>> upgrade to "Python-2.7.2.tar.bz2".

>
> Ah gotcha. I believe you can 'sudo apt-get install python2.7' - at
> least, you can on the Ubuntu system next to me. Not sure though; I build
> my Python from source straight from Mercurial.
>
> What you have there, I think, is a source code snapshot. You'd need to
> extract it and then do the usual incantation: $ ./configure
> $ make
> $ sudo make install


And you have now potentially broken your system python

Generally speaking, unless you are an expert, you should not use make
install when installing Python from source, because it will replace the
system Python with the newly installed one.

Instead use `sudo make altinstall`. This is exactly the same as install,
except it won't replace the python symlink that points to the actual
Python executable. That way system tools that call Python get the version
they are expecting, together with any libraries installed for their use,
while you can call the version you prefer manually. Or set up an alias in
your bashrc file.


> If you don't have the compiler/build environment set up, you'll have to
> do that first.


The trickiest part for me is ensuring that tkinter works correctly. After
installing Python from source about a dozen times now, I still don't know
why sometimes it works and sometimes it doesn't.


--
Steven
 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      12-05-2011
On Tue, Dec 6, 2011 at 3:23 AM, Steven D'Aprano
<(E-Mail Removed)> wrote:
> Generally speaking, unless you are an expert, you should not use make
> install when installing Python from source, because it will replace the
> system Python with the newly installed one.
>
> Instead use `sudo make altinstall`


Mea culpa, forgot that. Yes, use altinstall. Although it's probably
not a problem to replace 2.6.6 with 2.7.2 - I doubt that'll break many
things.

ChrisA
 
Reply With Quote
 
Anssi Saari
Guest
Posts: n/a
 
      12-14-2011
Christian Heimes <(E-Mail Removed)> writes:

>> Mea culpa, forgot that. Yes, use altinstall. Although it's probably
>> not a problem to replace 2.6.6 with 2.7.2 - I doubt that'll break many
>> things.

>
> Except that all 3rd party extensions and packages are missing if you
> install Python manually.


True, they would have to be built or at least installed manually also.
Major work, especially for a beginner. Shouldn't pick Debian Stable and
then want current software...

Then again, even the standard install of Python has plenty of stuff. I
installed 2.7.2 on my Debian system just to try out some of the new Tk
stuff.

> Debian's backports should provide a well integrated Python 2.7
> package.


But it doesn't. Python 2.7.2 is in Wheezy, which is the current testing
version of Debian. Looks like it has about 700 release critical bugs, so
it'll be a while until release.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
[ANN] Builds of PyWebkitGtk and Webkit-Glib-Gtk(r39359+#16401.master) for Debian i386,Debian AMD64 and Macports MacOSX 10.4 Luke Kenneth Casson Leighton Python 0 12-31-2008 08:23 PM
[flash tutorial]install OpenVPN on Debian reza.behroozi@gmail.com Cisco 0 07-28-2007 01:05 AM
Debian wont install onto my SATA hard drive? Boaby Computer Support 1 10-03-2005 12:35 AM
[Debian] Upgrading to kernel 2.6 in Debian DUser NZ Computing 0 01-11-2004 12:38 AM



Advertisments