Skip to content

invalid command 'bdist_wheel' error when installing SYSTEM Python packages, including EasyBuild on EL systems #5145

@Flamefire

Description

@Flamefire

Even eb --install-latest-eb-release may fail with

Using pip 23.3.2 from /usr/lib/python3.12/site-packages/pip (python 3.12)
Processing /trinity/easybuild/build/EasyBuild/5.2.0/system-system/easybuild-framework-5.2.0
  Running command Preparing metadata (pyproject.toml)
  error: invalid command 'bdist_wheel'
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

This can usually be resolved by installing the wheel Python package. However on EL10 ( e.g. Rocky 10) this still fails as there doesn't seem to be an OS wheel package. pip install wheel as root installs the wheel package to /usr/local where it isn't found when EasyBuild installs something.

Source of this issue is that there is a /usr/lib64/python3.12/site.py file which has this code:

if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ:
    PREFIXES.insert(0, "/usr/local")

So /usr/local is not added when PYTHONNOUSERSITE is set, which we do set for all pip installations in EasyBuild. It only causes issues on such systems and when using SYSTEM python. The only source on where this originates is this SUSE CR: https://build.opensuse.org/projects/SUSE:SLE-15-SP6:Update/packages/python39.42007/files/F00251-change-user-install-location.patch?expand=0

setuptools >= 70.1 avoids the problem by "ingesting" the bdist_wheel functionality from wheel

It is also not possible to workaround this by setting PYTHONPATH because we remove those:

* Undefines all $PYTHON* environment variables,
since they may affect the build/install procedure of Python packages.
cfr. https://docs.python.org/2/using/cmdline.html#environment-variables
While the $PYTHON* environment variables may be relevant/required for EasyBuild itself,
and for any non-stdlib Python packages it uses,
they are irrelevant (and potentially harmful) when installing Python packages.

A workaround from the user would be to install to /usr: pip install --prefix=/usr wheel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions