Installing Python 3000 on Leopard (Mac OS) fails...

A

André

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é
 
A

André

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é

I encountered the same error after downloading 'darwinports' (http://
darwinports.com/), installing it and
doing the following:

sudo ./port install python30

This is getting to be frustrating :-(

André
 
R

Robin Kåveland Hansen

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é

The posix-man-page on setpgrp declares the setpgrp prototype as pid_t
setpgrp(void);, which makes this sort of weird I guess.

You could check if it worked to change the relevant function call from
setpgrp() to setpgrp(0, 0)? Just search for posix_setpgrp, and make sure
that the function isn't called with an empty argument list.

Though I believe this is something for the core python developers and not
for me to fix, or even advice in, so if you want to be on the safe side to
ensure no breakage, don't touch it on my advice.
 
M

Martin v. Löwis

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?

This is a known bug:

http://bugs.python.org/issue1358

Apparently, Apple has managed to change the header files of Leopard
in a way that breaks building Python, and also managed to break
the autoconf procedure that was designed to deal with the uncertainty
of the setpgrp declaration.

An expert of OSX will need to look into this and propose a solution;
if you think you need to get this working, just remove setpgrp from
posixmodule.

Regards,
Martin
 
A

André

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"
11. print("Hello world!")
12. Be happy!

André, hoping this report might help some other newbie.
 
J

jim-on-linux

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"
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.

I don't like to read instructions but in the long run, it saves time.

jim-on-linux
http://www.inqvista.com
 
A

André

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

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".

Did that.
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...)

André
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top