Skip to content

pip install of fasttext package is failing #249

@SaschaSchwarze0

Description

@SaschaSchwarze0

This simple project, https://github.com/src2img/e2e/tree/python-pip-fasttext, is containing a Python project with just one library in its requirements.txt, fastText.

The sample also contains a Dockerfile that mimics the steps that Paketo imo performs = it uses Python 3.10, pip is updated so that it is at version 23.1.2, it runs as non-root then a pip install command with the same arguments that Paketo uses. The Dockerfile succeeds, Paketo does not.

Expected Behavior

pip install succeeds

Current Behavior

It fails like this:

[builder]   Executing build process
[builder]     Running 'pip install --requirement requirements.txt --exists-action=w --cache-dir=/layers/paketo-buildpacks_pip-install/cache --compile --user --disable-pip-version-check'
[builder]       Collecting fasttext==0.9.2 (from -r requirements.txt (line 1))
[builder]         Downloading fasttext-0.9.2.tar.gz (68 kB)
[builder]            ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 68.8/68.8 kB 409.4 kB/s eta 0:00:00
[builder]         Installing build dependencies: started
[builder]         Installing build dependencies: finished with status 'done'
[builder]         Getting requirements to build wheel: started
[builder]         Getting requirements to build wheel: finished with status 'error'
[builder]         error: subprocess-exited-with-error
[builder]         
[builder]         × Getting requirements to build wheel did not run successfully.
[builder]         │ exit code: 1
[builder]         ╰─> [25 lines of output]
[builder]             /layers/paketo-buildpacks_cpython/cpython/bin/python: No module named pip
[builder]             Traceback (most recent call last):
[builder]               File "<string>", line 38, in __init__
[builder]             ModuleNotFoundError: No module named 'pybind11'
[builder]             
[builder]             During handling of the above exception, another exception occurred:
[builder]             
[builder]             Traceback (most recent call last):
[builder]               File "/layers/paketo-buildpacks_pip/pip/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
[builder]                 main()
[builder]               File "/layers/paketo-buildpacks_pip/pip/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
[builder]                 json_out['return_val'] = hook(**hook_input['kwargs'])
[builder]               File "/layers/paketo-buildpacks_pip/pip/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
[builder]                 return hook(config_settings)
[builder]               File "/tmp/pip-build-env-d30ersr5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
[builder]                 return self._get_build_requires(config_settings, requirements=['wheel'])
[builder]               File "/tmp/pip-build-env-d30ersr5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
[builder]                 self.run_setup()
[builder]               File "/tmp/pip-build-env-d30ersr5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 487, in run_setup
[builder]                 super(_BuildMetaLegacyBackend,
[builder]               File "/tmp/pip-build-env-d30ersr5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in run_setup
[builder]                 exec(code, locals())
[builder]               File "<string>", line 72, in <module>
[builder]               File "<string>", line 41, in __init__
[builder]             RuntimeError: pybind11 install failed.
[builder]             [end of output]

Possible Solution

Steps to Reproduce

  1. git clone https://github.com/src2img/e2e
  2. cd e2e
  3. git checkout python-pip-fasttext
  4. pack build --builder paketobuildpacks/builder-jammy-full myimage

Motivations

Additional Information

There is a pull request open against fastText that aims to resolve exactly the error from above (facebookresearch/fastText#1331). Though, I am not a Python/Pip expert to assess if it is applicable. So wondering why it works without that fix in the Dockerfile approach.

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