3

One of my src rpms submitted to Copr for build failed because there is no Python implementation; is this because something is wrong with the src rpm itself, or there is simply no Python implementation on copr machines, or did I miss some settings?

checking for perl... /usr/bin/perl
checking for python... no
BUILDSTDERR: configure: error: You need 'python' to compile XXX
Peter Mortensen
  • 1,029
  • 1
  • 8
  • 10
Cyker
  • 4,174
  • 6
  • 34
  • 45

1 Answers1

8

It's very likely that you are missing one or more of:

BuildRequires: python2-devel

BuildRequires: python3-devel

BuildRequires: python-unversioned-command

in your spec file. The build environment starts out rather minimal and BuildRequires are used to pull in additional things. Python is rather large, so there was effort to move it from the default buildroot a little while ago.

See Dependencies in the Python section of the Fedora Packaging Guidelines.

If your program refers to /usr/bin/python without a version number, you'll need python-unversion-command. See this Fedora change for detail on that — in short, upstream Python has decided that /usr/bin/python can refer to either version depending on what the user wants, which means that operating system packages should really use either python2 or python3 explicitly. Requiring the unversioned command is an option for when you don't want to patch your program to do that for whatever reason.

mattdm
  • 39,535
  • 18
  • 99
  • 133
  • hello, i added that line in spec, but configure still fails; same error (no python); it's the [webkitgtk](https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/26/Everything/source/tree/Packages/w/webkitgtk-2.4.11-5.fc26.src.rpm) source rpm pulled from fedora 26 (because it was removed since fedora 27); – Cyker Jan 12 '19 at 18:08
  • Possible that that requires Python 2? – mattdm Jan 12 '19 at 18:11
  • it seems on fedora 29 `/usr/bin/python` is installed by package `python-unversioned-command`, neither `python2` nor `python3`; does this matter? [source](https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package) – Cyker Jan 12 '19 at 18:31
  • looks like problem goes away when i added `BuildRequires: python-unversioned-command` in addition to the other two `BuildRequires`; now it passed configure and started make; thank you very much; – Cyker Jan 12 '19 at 18:55