Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv pip install fails to install llama-cpp-python #6030

Closed
alonsosilvaallende opened this issue Aug 12, 2024 · 10 comments
Closed

uv pip install fails to install llama-cpp-python #6030

alonsosilvaallende opened this issue Aug 12, 2024 · 10 comments
Assignees
Labels
upstream An upstream dependency is involved

Comments

@alonsosilvaallende
Copy link

Thank you very much for this package. I'm encountering the following issue. In an emptly virtual environment, when I run

uv pip install llama-cpp-python --verbose

I obtain

DEBUG uv 0.2.35
DEBUG Searching for Python interpreter in system path
DEBUG Found `cpython-3.10.12-linux-x86_64-gnu` at `/home/asilva/test-llama-cpp/.venv/bin/python3` (active virtual environment)
DEBUG Using Python 3.10.12 environment at test-llama-cpp/.venv/bin/python3
DEBUG Acquired lock for `test-llama-cpp/.venv`
DEBUG At least one requirement is not satisfied: llama-cpp-python
DEBUG Using request timeout of 30s
DEBUG Solving with installed Python version: 3.10.12
DEBUG Adding direct dependency: llama-cpp-python*
DEBUG Found fresh response for: https://pypi.org/simple/llama-cpp-python/
DEBUG Searching for a compatible version of llama-cpp-python (*)
DEBUG Selecting: llama-cpp-python==0.2.87 [compatible] (llama_cpp_python-0.2.87.tar.gz)
DEBUG Acquired lock for `/home/asilva/.cache/uv/built-wheels-v3/pypi/llama-cpp-python/0.2.87`
DEBUG No cache entry for: https://files.pythonhosted.org/packages/a2/63/7b9fe4c6b9d52e1ed2c2689711cdbb60314cf13474c626accd4213cf937c/llama_cpp_python-0.2.87.tar.gz
DEBUG Downloading source distribution: llama-cpp-python==0.2.87
error: Failed to download and build `llama-cpp-python==0.2.87`
  Caused by: Failed to extract archive
  Caused by: failed to unpack `/home/asilva/.cache/uv/built-wheels-v3/.tmpvYPWA5/llama_cpp_python-0.2.87/vendor/llama.cpp/spm-headers/ggml-alloc.h`
  Caused by: File exists (os error 17) when symlinking ../ggml/include/ggml-alloc.h to /home/asilva/.cache/uv/built-wheels-v3/.tmpvYPWA5/llama_cpp_python-0.2.87/vendor/llama.cpp/spm-headers/ggml-alloc.h

Current uv version: uv 0.2.35

Current platform:
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

@baggiponte
Copy link

Uhm, I cannot decipher the last line:

Caused by: File exists (os error 17) when symlinking ../ggml/include/ggml-alloc.h to /home/asilva/.cache/uv/built-wheels-v3/.tmpvYPWA5/llama_cpp_python-0.2.87/vendor/llama.cpp/spm-headers/ggml-alloc.h

There might be another version of ggml-alloc somewhere in the machine?

@alonsosilvaallende
Copy link
Author

Uhm, I cannot decipher the last line:

Caused by: File exists (os error 17) when symlinking ../ggml/include/ggml-alloc.h to /home/asilva/.cache/uv/built-wheels-v3/.tmpvYPWA5/llama_cpp_python-0.2.87/vendor/llama.cpp/spm-headers/ggml-alloc.h

There might be another version of ggml-alloc somewhere in the machine?

Thank you very much for your answer @baggiponte
Any pointers on how to check if that is the case and how to remove it?

@alonsosilvaallende
Copy link
Author

I tested other versions of llama-cpp-python. Up to version llama-cpp-python=0.2.85 it works without any problem. The last two versions llama-cpp-python=0.2.86 and llama-cpp-python=0.2.87 do not work with uv anymore.

@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label Aug 12, 2024
@charliermarsh
Copy link
Member

I can take a look. My guess is we're refusing to overwrite a file with a symlink, or something like that.

@charliermarsh charliermarsh self-assigned this Aug 12, 2024
@charliermarsh
Copy link
Member

I think there might be something wrong with this source distribution. If you untar it, every entry is duplicated: tar -tf llama_cpp_python-0.2.87.tar.gz:

...
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-bpe.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-bpe.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-spm.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-1-spm.cpp
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-random.py
llama_cpp_python-0.2.87/vendor/llama.cpp/tests/test-tokenizer-random.py
...

I don't see the same issue with the prior release. Do you mind reporting this on the library itself?

@charliermarsh charliermarsh added upstream An upstream dependency is involved and removed compatibility Compatibility with a specification or another tool labels Aug 12, 2024
@charliermarsh
Copy link
Member

Nevermind, I commented on abetlen/llama-cpp-python#1670.

@henryiii
Copy link
Contributor

scikit-build-core 0.10.2 should fix this (thanks to @abetlen)!

@alonsosilvaallende
Copy link
Author

Great. Thank you very much. Should I close it then or leave it open until fixed in case other people are having the same issue?

@zanieb
Copy link
Member

zanieb commented Aug 13, 2024

Best to close it so we know we don't need to do anything here. Thanks!

@zanieb zanieb closed this as completed Aug 13, 2024
@alonsosilvaallende
Copy link
Author

For others looking at this issue, this has been solved in llama-cpp-python==0.2.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An upstream dependency is involved
Projects
None yet
Development

No branches or pull requests

5 participants