Error when building wheels on Linux FileNotFoundError: [Errno 2] No such file or directory: 'ninja'`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 65/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- cmake, docker, python
- Área
- build-system, devops
Línea de trabajo
El error ocurre durante la compilación del wheel cuando scikit-build-core intenta encontrar el programa 'ninja'. Revisa el Dockerfile o el entorno de compilación para asegurarte de que ninja esté instalado. Comprueba las dependencias de compilación del proyecto en pyproject.toml o setup.py. La corrección probablemente consiste en añadir ninja a los paquetes del sistema antes de pip install. Verifica esto ejecutando una compilación mínima de Docker que instale ninja-build y después intente ejecutar pip install.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am running the latest code. Development is very rapid so there are no tagged versions as of now.
- I carefully followed the README.md.
- I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
- I reviewed the Discussions, and have a new bug or useful enhancement to share.
Expected Behavior
Please provide a detailed written description of what you were trying to do, and what you expected llama-cpp-python to do.
Current Behavior
Building wheels results in error logs (see below).
Environment and Context
- Docker file, building from
ubuntu:jammy - llama-cpp-python versions tested
0.2.88and0.3.2. Behavior consistent. - Note that I'm still able to build from source directly on my MacOS, so it might be something specific to Linux
Failure Information (for bugs)
I'm unable to build wheels for llama-cpp-python in an ubuntu:jammy base Docker image. I get the error: FileNotFoundError: [Errno 2] No such file or directory: 'ninja'.
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue. We are not sitting in front of your screen, so the more detail the better.
git clone git@github.com:khoj-ai/khoj.gitcd khoj && docker build .
You should see the same error reproduced
Failure Logs
0 54.02
#0 54.02 × Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
#0 54.02 │ exit code: 1
#0 54.02 ╰─> [34 lines of output]
#0 54.02 *** scikit-build-core 0.10.7 using CMake 3.31.1 (wheel)
#0 54.02 *** Configuring CMake...
#0 54.02 Traceback (most recent call last):
#0 54.02 File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
#0 54.02 main()
#0 54.02 File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
#0 54.02 json_out['return_val'] = hook(**hook_input['kwargs'])
#0 54.02 File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
#0 54.02 return _build_backend().build_wheel(wheel_directory, config_settings,
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/build/__init__.py", line 33, in build_wheel
#0 54.02 return _build_wheel_impl(
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/build/wheel.py", line 175, in _build_wheel_impl
#0 54.02 return _build_wheel_impl_impl(
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/build/wheel.py", line 402, in _build_wheel_impl_impl
#0 54.02 builder.configure(
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/builder/builder.py", line 166, in configure
#0 54.02 local_def = set_environment_for_gen(
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/builder/generator.py", line 121, in set_environment_for_gen
#0 54.02 ninja = best_program(get_ninja_programs(), version=ninja_settings.version)
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/program_search.py", line 169, in best_program
#0 54.02 for program in programs:
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/program_search.py", line 136, in get_ninja_programs
#0 54.02 result = Run().capture(ninja_path, "--version")
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/_shutil.py", line 43, in capture
#0 54.02 return self._run(args, capture=True)
#0 54.02 File "/tmp/pip-build-env-gvxo9xjm/overlay/local/lib/python3.10/dist-packages/scikit_build_core/_shutil.py", line 71, in _run
#0 54.02 return subprocess.run(
#0 54.02 File "/usr/lib/python3.10/subprocess.py", line 503, in run
#0 54.02 with Popen(*popenargs, **kwargs) as process:
#0 54.02 File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
#0 54.02 self._execute_child(args, executable, preexec_fn, close_fds,
#0 54.02 File "/usr/lib/python3.10/subprocess.py", line 1863, in _execute_child
#0 54.02 raise child_exception_type(errno_num, err_msg, err_filename)
#0 54.02 FileNotFoundError: [Errno 2] No such file or directory: 'ninja'
#0 54.02 [end of output]
#0 54.02
#0 54.02 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 54.02 ERROR: Failed building wheel for llama-cpp-python
#0 54.02 Building wheel for openai-whisper (pyproject.toml): started
#0 54.25 Building wheel for openai-whisper (pyproject.toml): finished with status 'done'
#0 54.25 Created wheel for openai-whisper: filename=openai_whisper-20240930-py3-none-any.whl size=803338 sha256=3fe6a790d061e0fd0fb7f67fab76b6662233ee67d68b41f45ba25df64f21df59
#0 54.25 Stored in directory: /tmp/pip-ephem-wheel-cache-y4xjqtu_/wheels/dd/4a/1f/d1c4bf3b9133c8168fe617ed979cab7b14fe381d059ffb9d83
#0 54.25 Successfully built khoj docx2txt openai-whisper
#0 54.26 ERROR: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects
#0 54.26 Failed to build llama-cpp-python
------
Here's the pyproject.toml it's using to build: link.
You can see the full error logs in the GitHub Action workflow.
I noticed the ninja project had a release recently, but the error is still consistent if I downgrade ninja to 1.11.1.1.
Our workflow has been running smoothly, and this is the first time we encountered the error (about two hours ago, ~1:00 PM PST). Any help is much appreciated 🙏🏾.
- Lenguaje dominante
- Python
- Estrellas
- 10.6k
- Forks
- 1.5k
- Merge medio
- 6 h 43 min
- PR fusionados (30 d)
- 2
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de abetlen/llama-cpp-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
abetlen/llama-cpp-python#2371 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
abetlen/llama-cpp-python#2352 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
abetlen/llama-cpp-python#2211 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
abetlen/llama-cpp-python#2210 ·
-
Improve error messages Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
abetlen/llama-cpp-python#2145 ·
Todos los issues de abetlen/llama-cpp-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
anthropics/skills#1811 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
speaches-ai/speaches#678 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
datalayer/mcp-compose#42 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
conda-forge/spacy-feedstock#177 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
UKGovernmentBEIS/inspect_evals#2523 ·