Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19096 > unrolled thread
| Started by | John Nagle <nagle@animats.com> |
|---|---|
| First post | 2012-01-18 10:00 -0800 |
| Last post | 2012-01-23 13:42 +0100 |
| Articles | 17 — 12 participants |
Back to article view | Back to comp.lang.python
Installing Python on CentOS 6 - a big pain John Nagle <nagle@animats.com> - 2012-01-18 10:00 -0800
Re: Installing Python on CentOS 6 - a big pain Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-01-18 13:30 -0500
Re: Installing Python on CentOS 6 - a big pain "J.O. Aho" <user@example.net> - 2012-01-18 21:16 +0100
Re: Installing Python on CentOS 6 - a big pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-18 23:32 +0000
Re: Installing Python on CentOS 6 - a big pain "Albert W. Hopkins" <marduk@letterboxes.org> - 2012-01-18 19:03 -0500
Re: Installing Python on CentOS 6 - a big pain alex23 <wuwei23@gmail.com> - 2012-01-18 19:10 -0800
Re: Installing Python on CentOS 6 - a big pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-19 04:36 +0000
Re: Installing Python on CentOS 6 - a big pain Chris Angelico <rosuav@gmail.com> - 2012-01-19 20:43 +1100
Re: Installing Python on CentOS 6 - a big pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-19 10:47 +0000
Re: Installing Python on CentOS 6 - a big pain Chris Angelico <rosuav@gmail.com> - 2012-01-19 22:05 +1100
Re: Installing Python on CentOS 6 - a big pain Noah Hall <enalicho@gmail.com> - 2012-01-19 11:08 +0000
Re: Installing Python on CentOS 6 - a big pain Christian Heimes <lists@cheimes.de> - 2012-01-19 12:16 +0100
Re: Installing Python on CentOS 6 - a big pain Chris Angelico <rosuav@gmail.com> - 2012-01-19 22:27 +1100
Re: Installing Python on CentOS 6 - a big pain Benedict Verheyen <benedict.verheyen@gmail.com> - 2012-01-20 10:39 +0100
Re: Installing Python on CentOS 6 - a big pain rusi <rustompmody@gmail.com> - 2012-01-20 09:32 -0800
Re: Installing Python on CentOS 6 - a big pain Anssi Saari <as@sci.fi> - 2012-01-20 13:42 +0200
Re: Installing Python on CentOS 6 - a big pain Benedict Verheyen <benedict.verheyen@gmail.com> - 2012-01-23 13:42 +0100
| From | John Nagle <nagle@animats.com> |
|---|---|
| Date | 2012-01-18 10:00 -0800 |
| Subject | Installing Python on CentOS 6 - a big pain |
| Message-ID | <4f1708cc$0$1649$742ec2ed@news.sonic.net> |
It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of
work. Here are the official CentOS install instructions:
http://www.centos.org/modules/newbb/viewtopic.php?topic_id=34515&forum=41
Not only do you have to build Python from source, you have to install
a lot of stuff before you can even build it. Then you have to install
various Python packages from multiple sources. Python doesn't work
with "yum"; you have to do it the hard way.
I know how to do all this, but it takes hours. I'm bringing up
a bare dedicated server remotely, which is a routine operation.
Python does not "just work". I should be able to command
"yum install python27". (And not clobber the Python 2.6 that
comes with CentOS.)
This sort of thing is why Python is losing market share.
John Nagle
[toc] | [next] | [standalone]
| From | Benjamin Kaplan <benjamin.kaplan@case.edu> |
|---|---|
| Date | 2012-01-18 13:30 -0500 |
| Message-ID | <mailman.4845.1326911410.27778.python-list@python.org> |
| In reply to | #19096 |
On Wed, Jan 18, 2012 at 1:00 PM, John Nagle <nagle@animats.com> wrote: > It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of work. > Here are the official CentOS install instructions: > > http://www.centos.org/modules/newbb/viewtopic.php?topic_id=34515&forum=41 > > Not only do you have to build Python from source, you have to install > a lot of stuff before you can even build it. Then you have to install > various Python packages from multiple sources. Python doesn't work > with "yum"; you have to do it the hard way. > > I know how to do all this, but it takes hours. I'm bringing up > a bare dedicated server remotely, which is a routine operation. > > Python does not "just work". I should be able to command > "yum install python27". (And not clobber the Python 2.6 that > comes with CentOS.) > > This sort of thing is why Python is losing market share. > > > John Nagle > -- What does this have to do with Python? It's CentOS (and Red Hat's) decision not to provide a package for Python 2.7. It's not feasible for the Python community to provide a repository for each of the 200+ Linux distributions. The instructions for building Python are exactly the same as to build any other large project and there is absolutely nothing that we can do about that- you can't compile a program without a compiler and you can't link to other programs without the development headers. You'll have the exact same problems if you want to install gcc 4.6.2 unless some 3rd party has decided to build the rpm for you.
[toc] | [prev] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2012-01-18 21:16 +0100 |
| Message-ID | <9nonliFk9lU1@mid.individual.net> |
| In reply to | #19096 |
John Nagle wrote: > It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of work. Here > are the official CentOS install instructions: > > http://www.centos.org/modules/newbb/viewtopic.php?topic_id=34515&forum=41 Don't see any official about the post, it's just another forum member who posts what he did to install a later version of Python than the default 2.6 that comes with RedHat EL (and those comes with CentOS). > Not only do you have to build Python from source, you have to install > a lot of stuff before you can even build it. To build a car, you need a lot of parts, and you need to build the engine too. If you are building something yourself, you need header files and gcc, no matter if it's python or something else you want, you need those things and lucky you that you don't have something like ms-windows, then you don't have a package manager which will install most of the things you need, you would need to hunt down everything yourself (I know ms-win has already compiled versions, but we are talking about compiling yourself). > Then you have to install > various Python packages from multiple sources. Python doesn't work > with "yum"; you have to do it the hard way. That's the life when you don't want to use what you are given for free, I'm sure someone would put up a repo for you if you paid them to compile python and all the modules for it. > I know how to do all this, but it takes hours. I'm bringing up > a bare dedicated server remotely, which is a routine operation. If you build your own RPMs, you can do that on your desktop machine, no need to do it on the underpowered VPS or really, you should have picked a distribution which gives you python 2.7 by default instead, just visit distrowatch.com and you can find at least one within two minutes. > Python does not "just work". I should be able to command > "yum install python27". (And not clobber the Python 2.6 that > comes with CentOS.) > > This sort of thing is why Python is losing market share. It's not Python developers fault that some distributions choose to stay with older versions of Python instead of switching to 3.2 at once, or that ms-win don't have python at all. If you want CentOS to have a newer python by default, then contact RedHat, but before they listen to you, you may need to get some RedHat licenses. -- //Aho
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2012-01-18 23:32 +0000 |
| Message-ID | <4f175693$0$29987$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #19096 |
On Wed, 18 Jan 2012 10:00:47 -0800, John Nagle wrote: > This sort of thing is why Python is losing market share. Only on Planet Nagle. Do you have any evidence that Python actually *is* losing market share, or are you just trolling? -- Steven
[toc] | [prev] | [next] | [standalone]
| From | "Albert W. Hopkins" <marduk@letterboxes.org> |
|---|---|
| Date | 2012-01-18 19:03 -0500 |
| Message-ID | <mailman.4848.1326931428.27778.python-list@python.org> |
| In reply to | #19096 |
On Wed, 2012-01-18 at 10:00 -0800, John Nagle wrote: > Python does not "just work". I should be able to command > "yum install python27". (And not clobber the Python 2.6 that > comes with CentOS.) > > This sort of thing is why Python is losing market share. > > Or — and this is the more likely scenario — it could be that this has nothing to do with the Python language per sé and you are just playing the whiny snot-nosed kid.
[toc] | [prev] | [next] | [standalone]
| From | alex23 <wuwei23@gmail.com> |
|---|---|
| Date | 2012-01-18 19:10 -0800 |
| Message-ID | <a9b58f57-45a5-469d-a7d7-287b651c8e70@k3g2000pbn.googlegroups.com> |
| In reply to | #19096 |
On Jan 19, 4:00 am, John Nagle <na...@animats.com> wrote: > It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot of > work. There must have been some radical changes between Centos 5 & 6, then, as building Python 2.7 from scratch took all of 10 minutes. > Here are the official CentOS install instructions: The person who posted that has the forum designation "Newbie". Those aren't the official anything. > Not only do you have to build Python from source, you have to install > a lot of stuff before you can even build it. Then you have to install > various Python packages from multiple sources. Python doesn't work > with "yum"; you have to do it the hard way. > > I know how to do all this, but it takes hours. So you're of course building an rpm as you go to prevent the need for you or anyone else having to do this again, right? You're not some selfish asshole who expects "The Python Community" to do everything for him, are you? > Python does not "just work". I should be able to command > "yum install python27". (And not clobber the Python 2.6 that > comes with CentOS.) If only someone had just recently boasted about being able to do just this and had built an rpm to prove it... > This sort of thing is why Python is losing market share. If Python is losing anything it's from the endless FUD spouted by yourself and others.
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2012-01-19 04:36 +0000 |
| Message-ID | <4f179db1$0$14012$c3e8da3$76491128@news.astraweb.com> |
| In reply to | #19111 |
On Wed, 18 Jan 2012 19:10:43 -0800, alex23 wrote: > On Jan 19, 4:00 am, John Nagle <na...@animats.com> wrote: >> It turns out that installing Python 2.7.2 on CentOS 6.0 is a lot >> of >> work. > > There must have been some radical changes between Centos 5 & 6, then, as > building Python 2.7 from scratch took all of 10 minutes. Reading between the lines, I guess that John has set up his Centos boxes without development tools. I've known sys admins like that: in an effort to "increase security" they take away dev tools so that anybody breaking in can't install anything underhanded, at least in theory. With all the tools installed, it's a matter of a few minutes effort to build from scratch: download the tar ball extract the contents of the file cd into the source directory run ./configure run make optionally run make test run sudo make altinstall As a total n00b who'd never used make before, it took me 25 minutes effort on my first attempt, including reading the entire README file (twice!). Now I have the whole process down to about 30 seconds effort, and six minutes elapsed time, on my laptop. But obviously you can't build from source without a compiler. So under those circumstances, it would be very difficult to build from source, as you need to install make, gcc, and who knows what other tools, and fight with the cryptic error messages generated until eventually it all Just Works. I hate to imagine how much effort would be involved. And I can't fathom why John imagines that this is Python's fault. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-01-19 20:43 +1100 |
| Message-ID | <mailman.4856.1326966207.27778.python-list@python.org> |
| In reply to | #19113 |
On Thu, Jan 19, 2012 at 3:36 PM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > With all the tools installed, it's a matter of a few minutes effort to > build from scratch: > > run ./configure > run make > run sudo make altinstall > > As a total n00b who'd never used make before, it took me 25 minutes > effort on my first attempt, including reading the entire README file > (twice!). Now I have the whole process down to about 30 seconds effort, > and six minutes elapsed time, on my laptop. The first time I built a Python 3, I didn't know about 'make altinstall', and managed to make something of a mess of my system (the default Python is 2.6.6 on Ubuntu, IIRC, and there are system scripts that don't work on Py3). But now, it's pretty easy, as yesterday can attest: I did a fresh install of Debian, starting at about 11AM, and by mid-afternoon everything was built and deployed. Most of that time was spent cloning about 8-10 source repositories (including one local one of "work stuff") and building stuff from source, and not one of the programs gave me any trouble. Python 3 was among them. Now, granted, this was Debian and I can't speak for Centos. But it would surprise me greatly if your package manager can't provide build essentials. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2012-01-19 10:47 +0000 |
| Message-ID | <4f17f4c7$0$29987$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #19119 |
On Thu, 19 Jan 2012 20:43:23 +1100, Chris Angelico wrote: > On Thu, Jan 19, 2012 at 3:36 PM, Steven D'Aprano > <steve+comp.lang.python@pearwood.info> wrote: >> With all the tools installed, it's a matter of a few minutes effort to >> build from scratch: [...] > Now, granted, this was Debian and I can't speak for Centos. But it would > surprise me greatly if your package manager can't provide build > essentials. I daresay any decent package manager would be able to provide the complete tool chain for building Python from source. But I have no idea what tools are needed -- gcc and make, obviously, but what else? Maybe it really is as simple as "yum install gcc make", but I suspect that it won't be. "yum install gcc make yacc bison elephant weasel fox cow spam ham cheese chalk aardvark" perhaps. (I may have made one or two of those up.) Best of all, if the BOFH who built your system deliberately removed the package manager, what are you going to do then? :) But really, we're all just guessing here. Unless John Nagle decides to tell us, we have *no idea* why he found it so difficult to build from source. "No compiler tools" is just my guess. -- Steven
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-01-19 22:05 +1100 |
| Message-ID | <mailman.4858.1326971156.27778.python-list@python.org> |
| In reply to | #19122 |
On Thu, Jan 19, 2012 at 9:47 PM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > I daresay any decent package manager would be able to provide the > complete tool chain for building Python from source. But I have no idea > what tools are needed -- gcc and make, obviously, but what else? Maybe it > really is as simple as "yum install gcc make", but I suspect that it > won't be. "yum install gcc make yacc bison elephant weasel fox cow spam > ham cheese chalk aardvark" perhaps. (I may have made one or two of those > up.) What I do is apt-get the most obvious things (g++/gcc and make, in this case), then run configure and see if it bombs, then run make and see if it bombs, and whenever there's a "command not found", attempt to apt-get that command as a package name. It usually works. Generally, if my boss (not as familiar with the commands as I, and prefers GUI tools where possible) asks me to set down exactly what I needed to do to get XYZ going, the notes end up looking pretty prohibitive, but it doesn't take long to guess your way through things. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Noah Hall <enalicho@gmail.com> |
|---|---|
| Date | 2012-01-19 11:08 +0000 |
| Message-ID | <mailman.4859.1326971352.27778.python-list@python.org> |
| In reply to | #19122 |
On Thu, Jan 19, 2012 at 10:47 AM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > On Thu, 19 Jan 2012 20:43:23 +1100, Chris Angelico wrote: > >> On Thu, Jan 19, 2012 at 3:36 PM, Steven D'Aprano >> <steve+comp.lang.python@pearwood.info> wrote: >>> With all the tools installed, it's a matter of a few minutes effort to >>> build from scratch: > > [...] >> Now, granted, this was Debian and I can't speak for Centos. But it would >> surprise me greatly if your package manager can't provide build >> essentials. > > I daresay any decent package manager would be able to provide the > complete tool chain for building Python from source. But I have no idea > what tools are needed -- gcc and make, obviously, but what else? Maybe it > really is as simple as "yum install gcc make", but I suspect that it > won't be. "yum install gcc make yacc bison elephant weasel fox cow spam > ham cheese chalk aardvark" perhaps. (I may have made one or two of those > up.) I am fairly certain nobody would be silly enough to make a package called "gcc". "make", maybe, but not gcc. I mean, that's not even a real word! yum groupinstall "Development Tools" will probably do what the OP needs unless 6 no longer has it.
[toc] | [prev] | [next] | [standalone]
| From | Christian Heimes <lists@cheimes.de> |
|---|---|
| Date | 2012-01-19 12:16 +0100 |
| Message-ID | <mailman.4860.1326971824.27778.python-list@python.org> |
| In reply to | #19122 |
Am 19.01.2012 12:05, schrieb Chris Angelico: > What I do is apt-get the most obvious things (g++/gcc and make, in > this case), then run configure and see if it bombs, then run make and > see if it bombs, and whenever there's a "command not found", attempt > to apt-get that command as a package name. It usually works. Much easier: $ apt-get build-dep python In general the 'build-essential' package provides almost every part of the build chain (compilers, make, autotools, yacc & friends): $ apt-get install build-essential Christian
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2012-01-19 22:27 +1100 |
| Message-ID | <mailman.4861.1326972455.27778.python-list@python.org> |
| In reply to | #19122 |
On Thu, Jan 19, 2012 at 10:16 PM, Christian Heimes <lists@cheimes.de> wrote: > Much easier: > > $ apt-get build-dep python In the specific case where that's available, it's fine. I've not gotten into the habit of trusting it, though, largely because a lot of what I compile _isn't_ in the package manager - otherwise I'd just apt-get the thing and save the trouble. (Although, more and more, I'm finding that I want to update to a version that isn't in Debian's repo - eg SciTE has had a LOT of new features since the version in repository - so I end up compiling from source still.) ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Benedict Verheyen <benedict.verheyen@gmail.com> |
|---|---|
| Date | 2012-01-20 10:39 +0100 |
| Message-ID | <mailman.4875.1327052395.27778.python-list@python.org> |
| In reply to | #19113 |
On 19/01/2012 5:36, Steven D'Aprano wrote: > On Wed, 18 Jan 2012 19:10:43 -0800, alex23 wrote: > <snip> > > download the tar ball > extract the contents of the file > cd into the source directory > run ./configure > run make > optionally run make test > run sudo make altinstall > > As a total n00b who'd never used make before, it took me 25 minutes > effort on my first attempt, including reading the entire README file > (twice!). Now I have the whole process down to about 30 seconds effort, > and six minutes elapsed time, on my laptop. > <snip> My first attempt to compile it on Debian took some extra steps, as Python didn't find the ncurses and and readline libs. But it was still easy to figure out how to build and install (locally) all the necessary packages. I leave the system installed python alone, and install the python version I built in $HOME/usr/local so I can later use this in a virtualenv. These are part of my notes from a while back so version might not be up to date anymore. 1. Compile zlib tar xzvf zlib-1.2.5.tar.gz cd zlib-1.2.5 ./configure --64 --prefix=$HOME/usr/local make make install 2. Compile readline tar xzvf readline-6.1.tar.gz ./configure --enable-shared --prefix=$HOME/usr/local make make install 3. Compile ncurses tar xzvf ncurses-5.7 ./configure --with-shared --enable-termcap --prefix=$HOME/usr/local make make install 4. Install Python from source tar xzvf Python-2.7.2.gz cd Python-2.7.2 export LDFLAGS="-L$HOME/usr/local" ./configure --enable-shared --prefix=$HOME/usr/local make make install If i need to install a new version of Python, as I happen to have done today, I only need to do step 4. Which is maybe 5 minutes of work. Cheers, Benedict
[toc] | [prev] | [next] | [standalone]
| From | rusi <rustompmody@gmail.com> |
|---|---|
| Date | 2012-01-20 09:32 -0800 |
| Message-ID | <b1472020-cf81-414a-9c98-63f114aed878@pt5g2000pbb.googlegroups.com> |
| In reply to | #19141 |
On Jan 20, 2:39 pm, Benedict Verheyen <benedict.verhe...@gmail.com> wrote: > On 19/01/2012 5:36, Steven D'Aprano wrote: > > > > > > > > > On Wed, 18 Jan 2012 19:10:43 -0800, alex23 wrote: > > <snip> > > > download the tar ball > > extract the contents of the file > > cd into the source directory > > run ./configure > > run make > > optionally run make test > > run sudo make altinstall > > > As a total n00b who'd never used make before, it took me 25 minutes > > effort on my first attempt, including reading the entire README file > > (twice!). Now I have the whole process down to about 30 seconds effort, > > and six minutes elapsed time, on my laptop. > > <snip> > > My first attempt to compile it on Debian took some extra steps, > as Python didn't find the ncurses and and readline libs. > But it was still easy to figure out how to build and install (locally) all > the necessary packages. > I leave the system installed python alone, and install the python version > I built in $HOME/usr/local so I can later use this in a virtualenv. > > These are part of my notes from a while back so version might not be > up to date anymore. > > 1. Compile zlib > tar xzvf zlib-1.2.5.tar.gz > cd zlib-1.2.5 > ./configure --64 --prefix=$HOME/usr/local > make > make install > > 2. Compile readline > tar xzvf readline-6.1.tar.gz > ./configure --enable-shared --prefix=$HOME/usr/local > make > make install > > 3. Compile ncurses > tar xzvf ncurses-5.7 > ./configure --with-shared --enable-termcap --prefix=$HOME/usr/local > make > make install If you apt-get the foll libncurses5-dev libreadline6-dev zlib1g-dev the first three steps should not be necessary. In general apt-get build-dep python2.7 will list out (a superset of) what python2.7 needs. > > 4. Install Python from source > tar xzvf Python-2.7.2.gz > cd Python-2.7.2 > export LDFLAGS="-L$HOME/usr/local" > ./configure --enable-shared --prefix=$HOME/usr/local > make > make install > > If i need to install a new version of Python, as I happen to have done today, > I only need to do step 4. Which is maybe 5 minutes of work. > > Cheers, > Benedict
[toc] | [prev] | [next] | [standalone]
| From | Anssi Saari <as@sci.fi> |
|---|---|
| Date | 2012-01-20 13:42 +0200 |
| Message-ID | <vg34nvqur2n.fsf@sci.fi> |
| In reply to | #19141 |
Benedict Verheyen <benedict.verheyen@gmail.com> writes: > If i need to install a new version of Python, as I happen to have done today, > I only need to do step 4. Which is maybe 5 minutes of work. I don't really understand why you compile these common libraries (zlib, ncurses, readline) yourself instead of using the relevant libraries provided by your Debian system? Is it just that you didn't *know* Debian puts parts needed for compilation in separate packages so you'd need to install those first?
[toc] | [prev] | [next] | [standalone]
| From | Benedict Verheyen <benedict.verheyen@gmail.com> |
|---|---|
| Date | 2012-01-23 13:42 +0100 |
| Message-ID | <mailman.4961.1327322552.27778.python-list@python.org> |
| In reply to | #19161 |
On 20/01/2012 12:42, Anssi Saari wrote: > Benedict Verheyen <benedict.verheyen@gmail.com> writes: > >> If i need to install a new version of Python, as I happen to have done today, >> I only need to do step 4. Which is maybe 5 minutes of work. > > I don't really understand why you compile these common libraries (zlib, > ncurses, readline) yourself instead of using the relevant libraries > provided by your Debian system? Is it just that you didn't *know* Debian > puts parts needed for compilation in separate packages so you'd need to > install those first? > I know Debian puts them in separate packages dev libraries, I was merely interested in building them myself, as it isn't really a pain to do so. I hadn't previously messed about a lot with compiling packages and I wanted to try it out for Python. Cheers, Benedict
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web