Distutils - bdist_rpm - specify python interpretter location

Ian Pilcher arequipeno at gmail.com
Wed Oct 30 17:35:55 EDT 2019


I am trying to use Distutils "bdist_rpm" function on Fedora 30.  It is
failing, because Fedora does not provide a "python" executable; it
provides /usr/bin/python2 and /usr/bin/python3.

The error message is:

   env: 'python': No such file or directory
   error: Bad exit status from /var/tmp/rpm-tmp.a3xWMd (%build)

When run with the --spec-only option, one can see where 'python' is
used in the generated SPEC file:

   %build
   env CFLAGS="$RPM_OPT_FLAGS" python setup.py build

   %install
   python setup.py install -O1 --root=$RPM_BUILD_ROOT 
--record=INSTALLED_FILES

Is there a way to tell Distutils to use 'python2'?

Thanks!

-- 
========================================================================
Ian Pilcher                                         arequipeno at gmail.com
-------- "I grew up before Mark Zuckerberg invented friendship" --------
========================================================================



More information about the Python-list mailing list