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

pip install llama-cpp-python on anaconda #1654

Open
werruww opened this issue Aug 5, 2024 · 5 comments
Open

pip install llama-cpp-python on anaconda #1654

werruww opened this issue Aug 5, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@werruww
Copy link

werruww commented Aug 5, 2024

(base) C:\Users\m>pip install llama-cpp-python
Collecting llama-cpp-python
Using cached llama_cpp_python-0.2.85.tar.gz (49.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: typing-extensions>=4.5.0 in c:\users\m\appdata\local\anaconda3\lib\site-packages (from llama-cpp-python) (4.7.1)
Requirement already satisfied: numpy>=1.20.0 in c:\users\m\appdata\local\anaconda3\lib\site-packages (from llama-cpp-python) (1.24.3)
Requirement already satisfied: diskcache>=5.6.1 in c:\users\m\appdata\local\anaconda3\lib\site-packages (from llama-cpp-python) (5.6.3)
Requirement already satisfied: jinja2>=2.11.3 in c:\users\m\appdata\local\anaconda3\lib\site-packages (from llama-cpp-python) (3.1.2)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\m\appdata\local\anaconda3\lib\site-packages (from jinja2>=2.11.3->llama-cpp-python) (2.1.1)
Building wheels for collected packages: llama-cpp-python
Building wheel for llama-cpp-python (pyproject.toml) ... | ########He stands and does not complete

@werruww
Copy link
Author

werruww commented Aug 5, 2024

conda install conda-forge::llama-cpp-python not work

@werruww
Copy link
Author

werruww commented Aug 5, 2024

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
gensim 4.3.0 requires FuzzyTM>=0.4.0, which is not installed.
tables 3.8.0 requires blosc2~=2.0.0, which is not installed.
tables 3.8.0 requires cython>=0.29.21, which is not installed.
numba 0.57.1 requires numpy<1.25,>=1.21, but you have numpy 2.0.1 which is incompatible.
scipy 1.11.1 requires numpy<1.28.0,>=1.21.6, but you have numpy 2.0.1 which is incompatible.

@jcardonnet
Copy link

I had the same issue.
I got it working using uv to install the package:
uv pip install -U llama-cpp-python
The difference seems to be that pip tried to build the wheel instead of using the prebuilt one, but uv did the right thing.

@werruww
Copy link
Author

werruww commented Aug 6, 2024

pip install -U llama-cpp-python

.uvuv pip install -U llama-cpp-pythonpipuv

What do you mean and what is the correct installation command that stops in pyproject.toml?

@werruww
Copy link
Author

werruww commented Aug 6, 2024

(u) C:\Users\m\Desktop\1>python 1.py
Traceback (most recent call last):
File "C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\site-packages\llama_cpp\llama_cpp.py", line 75, in _load_shared_library
return ctypes.CDLL(str(lib_path), **cdll_args) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\ctypes_init
.py", line 376, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\site-packages\llama_cpp\lib\llama.dll' (or one of its dependencies). Try using the full path with constructor syntax.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\m\Desktop\1\1.py", line 2, in
from llama_cpp import Llama
File "C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\site-packages\llama_cpp_init_.py", line 1, in
from .llama_cpp import *
File "C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\site-packages\llama_cpp\llama_cpp.py", line 88, in
_lib = _load_shared_library(_lib_base_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\site-packages\llama_cpp\llama_cpp.py", line 77, in _load_shared_library
raise RuntimeError(f"Failed to load shared library '{_lib_path}': {e}")
RuntimeError: Failed to load shared library 'C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\site-packages\llama_cpp\lib\llama.dll': Could not find module 'C:\Users\m\AppData\Local\anaconda3\envs\u\Lib\site-packages\llama_cpp\lib\llama.dll' (or one of its dependencies). Try using the full path with constructor syntax.

(u) C:\Users\m\Desktop\1>

@abetlen abetlen added the bug Something isn't working label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants