Mathan Kumar
Mathan Kumar

Reputation: 684

Issue in build and install python3.2 in mac osx lion

I using Mac OSX Lion and I could easily install python3.2 using DMG installer setup available in python.org site. But i want to write some python-C functions and create a binary for it.
So for this purpose i tried to install python3.2 zip available in python.org site.

Instead stuck with installation errors when I use following install procedures

./configure --enable-framework
make
sudo make install

Error:

gcc -DPYTHONFRAMEWORK='"Python"' -o pythonw ./Tools/pythonw.c -I.. -I./../Include ../Python.framework/Versions/3.2/Python
/usr/bin/install -c -s pythonw "/Library/Frameworks/Python.framework/Versions/3.2/bin/pythonw3.2"
/usr/bin/install -c -s pythonw "/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2"
ln -sf python3.2 "/Library/Frameworks/Python.framework/Versions/3.2/bin/python3"
ln -sf pythonw3.2 "/Library/Frameworks/Python.framework/Versions/3.2/bin/pythonw3"
cd PythonLauncher && make install DESTDIR=
gcc -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -o FileSettings.o -c ./FileSettings.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:120,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:75: error: syntax error before ‘^’ token
make[2]: *** [FileSettings.o] Error 1
make[1]: *** [install_PythonLauncher] Error 2
make: *** [frameworkinstallapps] Error 2

Any help would be appreciated.

Upvotes: 1

Views: 659

Answers (1)

Ned Deily
Ned Deily

Reputation: 85095

Works for me. It seems very suspicious that you are seeing a syntax error on an Apple-supplied OS X header file. What version of Xcode do you have installed and which C compiler are you using (gcc --version)? Also, if your purpose is to build C extension modules there is normally no reason to build a Python from source. The Distutils package in the Python standard library takes care of all the build issues for you and all the needed header files are included in the python.org binary installers for Mac OS X.

UPDATE: In your new comment you indicate you want to run Python as 32-bit. The python.org 64-/32-bit installers for OS X are multi-architecture (or universal); each executable file contains executables for both arch x86_64 (64-bit) and for arch i386 (32-bit). Mac OS X 10.6 and 10.7 will prefer to run 64-bit executables where possible. To launch 64-bit/32-bit Pythons in 32-bit mode, try:

arch -i386 python3.2

For example:

python3.2 -c "import sys;print(sys.maxsize)"
9223372036854775807
arch -x86_64 python3.2 -c "import sys;print(sys.maxsize)"
9223372036854775807
arch -i386 python3.2 -c "import sys;print(sys.maxsize)"
2147483647

Upvotes: 0

Related Questions