Installing Python with pythonbrew on Mac OS-X
Using Pythonbrew to install Python on OS-X triggers some failures which prevent it being installed.
The issue is discussed on Github here.
Looking at ~/.pythonbrew/Logs/build.log, we see the following errors:
3 tests failed: test_ctypes test_distutils test_platform
test test_platform failed -- Traceback (most recent call last): File "/Users/adamgriffiths/.pythonbrew/build/Python-2.7.2/Lib/test/test_platform.py", line 194, in test_mac_ver self.assertEqual(res, 'i386') AssertionError: 'x86_64' != 'i386'
test_distutils i686-apple-darwin11-llvm-gcc-4.2: /private/var/folders/bz/9564twzd2f95kgzvzvt1w1yr0000gn/T/tmpE9o8JJ/foo.so: No such file or directory test test_distutils failed -- Traceback (most recent call last): File "/Users/adamgriffiths/.pythonbrew/build/Python-2.7.2/Lib/distutils/tests/test_build_ext.py", line 291, in test_get_outputs cmd.run() File "/Users/adamgriffiths/.pythonbrew/build/Python-2.7.2/Lib/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/Users/adamgriffiths/.pythonbrew/build/Python-2.7.2/Lib/distutils/command/build_ext.py", line 449, in build_extensions self.build_extension(ext) File "/Users/adamgriffiths/.pythonbrew/build/Python-2.7.2/Lib/distutils/command/build_ext.py", line 531, in build_extension target_lang=language) File "/Users/adamgriffiths/.pythonbrew/build/Python-2.7.2/Lib/distutils/ccompiler.py", line 741, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "/Users/adamgriffiths/.pythonbrew/build/Python-2.7.2/Lib/distutils/unixccompiler.py", line 258, in link raise LinkError, msg LinkError: command 'gcc' failed with exit status 1
I’ve commented about this issue here. Unfortunately, there isn’t a response from any authority on the issue.
Delving into the logs, it seems these errors (test_platform fails, etc) are just the results of bad tests.
If we take a look at ~/.pythonbrew/build/Python-2.7.2/Lib/test/test_platform.py at line 194, we see the following:
if sys.byteorder == 'little': self.assertEqual(res, 'i386') else: self.assertEqual(res, 'PowerPC')
Doing a uname -a gives the following:
Vibur:~ adamgriffiths$ uname -a Darwin Vibur.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
So obviously this test is not appropriate and we can ignore the error.
It looks like the other errors are similar too.
The code builds successfully, so I think its safe to ignore these.
Until these are patched out, it seems the only way to install Python with Pythonbrew is to use the –force command.
pythonbrew install 2.7.2 --force