abetlen / abetlen/llama-cpp-python
could not find llama.dll
- Lenguaje dominante
- Python
- Estrellas
- 10.6k
- Forks
- 1.4k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
I cannot import Llama:
`from llama_cpp import Llama`
This results in
```
{
"name": "RuntimeError",
"message": "Failed to load shared library 'c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama.dll': Could not find module 'c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama.dll' (or one of its dependencies). Try using the full path with constructor syntax.",
"stack": "---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama_cpp.py:78, in _load_shared_library(lib_base_name)
77 try:
---> 78 return ctypes.CDLL(str(_lib_path), **cdll_args)
79 except Exception as e:
File ~\\AppData\\Local\\Programs\\Python\\Python310\\lib\\ctypes\\__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
373 if handle is None:
--> 374 self._handle = _dlopen(self._name, mode)
375 else:
FileNotFoundError: Could not find module 'c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama.dll' (or one of its dependencies). Try using the full path with constructor syntax.
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
Cell In[1], line 1
----> 1 from llama_cpp import Llama
File c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\__init__.py:1
----> 1 from .llama_cpp import *
2 from .llama import *
4 __version__ = \"0.2.38\"
File c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama_cpp.py:91
88 _lib_base_name = \"llama\"
90 # Load the library
---> 91 _lib = _load_shared_library(_lib_base_name)
93 # Misc
94 c_float_p = POINTER(c_float)
File c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama_cpp.py:80, in _load_shared_library(lib_base_name)
78 return ctypes.CDLL(str(_lib_path), **cdll_args)
79 except Exception as e:
---> 80 raise RuntimeError(f\"Failed to load shared library '{_lib_path}': {e}\")
82 raise FileNotFoundError(
83 f\"Shared library with base name '{lib_base_name}' not found\"
84 )
RuntimeError: Failed to load shared library 'c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama.dll': Could not find module 'c:\\Users\\user\\Documents\\llamacpp\\llama-cpp-python\\llama_cpp\\llama.dll' (or one of its dependencies). Try using the full path with constructor syntax."
}
```
The installation process was standard, on windows 10. I have CUDA 12.1.
```
set CMAKE_ARGS=-DLLAMA_CUBLAS=on
set FORCE_CMAKE=1
pip install llama-cpp-python
```
The solutions from the other issues are not working (setting winmode=0 and/or adding the dll via add_dll_directory)
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.