pythonbrew
pythonbrew copied to clipboard
python 2.6.5 fails to install on Ubuntu 11.10
running build
running build_ext
Traceback (most recent call last):
File "./setup.py", line 1942, in /.pythonbrew/build/Python-2.6.5/Lib/distutils/core.py", line 152, in setup dist.run_commands() File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/dist.py", line 995, in run_command cmd_obj.run() File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/command/build.py", line 134, in run
self.run_command(cmd_name)
File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/.pythonbrew/build/Python-2.6.5/Lib/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "`/.pythonbrew/build/Python-2.6.5/Lib/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "./setup.py", line 103, in build_extensions
missing = self.detect_modules()
File "./setup.py", line 337, in detect_modules
self.add_multiarch_paths()
File "./setup.py", line 314, in add_multiarch_paths
if not find_executable('dpkg-architecture'):
NameError: global name 'find_executable' is not defined
make: *** [sharedmods] Error 1
I think that the problem is in the patch because the manual installation works
It looks that installing python require the package included "dpkg-architecture". So please try installing the package of "dpkg-dev". "dpkg-dev" might be including "dpkg-architecture".
dpkg-architecture is provided by dpkg-dev, but that isn't what is causing this error. I'm facing this same issue. After having spent an hour trying to figure out what was going on, I've finally discovered the cause.
When pythonbrew installs a python distribution, it will do the following:
- Download the tarball
- Extract the tarball
- Apply patches
- Configure
- Make ... etc
This error doesn't manifest until after everything is done and the setup.py is run, but it comes back to when the file is patched in step 3.
The patch that is being applied to 2.6.5 is all/common/patch-setup.py.diff. If you examine this patch, you will note that although it makes use of "find_executable" it does not explicitly import the function.
If you examine another patch, all/python25/patch-setup.py.diff, you will note that "from distutils.spawn import find_executable" is provided at the top. It is this import that is not being patched for 2.6.5 that is causing this error with setup.