It works! Was: Installing Python 3000
andre.roberge at gmail.com
Tue Nov 27 20:21:19 CET 2007
On Nov 27, 11:17 am, jim-on-linux <inq1... at inqvista.com> wrote:
> On Tuesday 27 November 2007 07:20, André wrote:
> > On Nov 26, 9:59 pm, "André" <andre.robe... at gmail.com> wrote:
> > > While I made some progress in trying to install Py3k from source
> > > (for the first time), it has failed...
> > > Here are the steps I went through (not necessarily in that order
> > > - except for those that matter).
> > > 1. After installing Leopard, install Xcode tools from the dvd -
> > > even if you had done so with a previous version (they need to be
> > > updated - trust me :-)
> > > 2. Download Python 3.0a1
> > > 3. Unpack the archive.
> > > 4. Go to /usr/local and make a directory "sudo mkdir py3k"
> > > (This is probably not needed, but that's what I did).
> > > 5. From the directory where the Python 3.0a1 was unpacked run
> > > ./configure --prefix=/usr/local/py3k
> > > 6. run "make"
> > > This last step failed with the following error message:
> > > gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
> > > -mno-fused- madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I.
> > > -I./Include - DPy_BUILD_CORE -c ./Modules/posixmodule.c -o
> > > Modules/posixmodule.o ./Modules/posixmodule.c: In function
> > > 'posix_setpgrp':
> > > ./Modules/posixmodule.c:3769: error: too few arguments to
> > > function 'setpgrp'
> > > make: *** [Modules/posixmodule.o] Error 1
> > > Any suggestions?
> > > André
> > Following Martin v Löwis's suggestion, I looked at
> > http://bugs.python.org/issue1358
> > and added the line
> > #define SETPGRP_HAVE_ARG
> > by hand to pyconfig.h (after it was created by configure). Then
> > 6. run "make"
> > 7. run "make test" (one test failed; this step likely unnecessary)
> > 8. sudo make altinstall
> > 9. sudo ln /usr/local/bin/py3k/python3.0 /usr/bin/python3.0
> > 10. type "python"
Should have been "python3.0"
> > 11. print("Hello world!")
> > 12. Be happy!
> > André, hoping this report might help some other newbie.
> Bug fix excluded,
> After unpacking the compressed version of Python, look for a file
> named "README".
> Open "README" and look for Installing. Make install and Make
> altinstall is explained.
make altinstall is mentioned (not "explained") in very brief comment.
This series of post followed from a previous one where I queried about
how to install py3k without it becoming the default. Many useful
suggestions were offered by others which I found very useful as I had
*never* installed/configured/made something from source before (I
always used .msi on Windows and, more recently, .dmg on Mac). Once
you know what/why things like "--prefix" or "--enable-framework" or
"altinstall" are for, the README file content becomes extremely clear.
> I don't like to read instructions but in the long run, it saves time.
Actually, I do try and read instructions first usually. But sometimes
the instructions use terms that are not clear for newbies. And, if I
may, the "normal" way to create an alias/link for unsophisticated Mac
users (like me) is to use the GUI (Finder) and ctrl-click on the
file. However, /usr is hidden ... and using "ln" is not something
that can be found in the README ...
So that is why, to save time for others, I thought of writing this
summary of what I did, so that it could be found by people searching
this newsgroup (which is one of the other things I did first...)
More information about the Python-list