[Distutils] Problem with build_rpm
M.-A. Lemburg
mal@lemburg.com
Wed Jun 13 10:53:00 2001
Juergen Hermann wrote:
>
> Hi!
>
> I tried build_rpm today and failed, because of this:
>
> + cd /home/jhe/src/python/extensions/cin/build/bdist.linux-i686/rpm/BUILD
> + cd cin-1.3
> + env 'CFLAGS=-O2 -m486 -fno-strength-reduce' python setup.py build
> Traceback (innermost last):
> File "setup.py", line 14, in ?
> from distutils.core import setup, Extension
> ImportError: No module named distutils.core
> Bad exit status from /var/tmp/rpm-tmp.49462 (%build)
> error: command 'rpm' failed with exit status 1
>
> The problem here is that "python" is Python 1.5, and setup.py has a "#!
> /usr/bin/env python2.1" bangpath, i.e. the call in the "+ env" line should
> use "sys.executable", not a fixed "python" string.
>
This helps:
# Python version to use
PYTHONVERSION = 2.0
PYTHON = python$(PYTHONVERSION)
$(PYTHON) setup.py bdist_rpm --python $(PYTHON)
--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting: http://www.egenix.com/
Python Software: http://www.lemburg.com/python/