3

one of my src rpm submitted to copr for build failed because there is no python; is this because something is wrong with the src rpm itself, or there is simply no python on copr machines, or I missed some settings?

checking for perl... /usr/bin/perl
checking for python... no
BUILDSTDERR: configure: error: You need 'python' to compile XXX
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.

  • hello, i added that line in spec, but configure still fails; same error (no python); it's the webkitgtk source rpm pulled from fedora 26 (because it was removed since fedora 27); – Cyker Jan 12 at 18:08
  • Possible that that requires Python 2? – mattdm Jan 12 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 – Cyker Jan 12 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 at 18:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.