Skip to content

Fix for shared library not found and compile issues in Windows #848

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

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

sujeendran
Copy link
Contributor

@sujeendran sujeendran commented Oct 27, 2023

I noticed that the library .dll file that gets installed in python site-packages location is actually libllama.dll while it is trying to look for llama.dll in the code in windows machine. After making this change and reinstalling from source, everything started working fine for me.

Also updated README.md to include some extra info for Windows users trying to build using w64devkit like llama.cpp.

Setup: Windows 10 Pro, Intel CPU i7 12th gen.

Issues related: #568 #825 #751

@tk-master
Copy link
Contributor

well I get this error after I apply this pr

Traceback (most recent call last):
File "I:\llama-cpp-python\test.py", line 12, in
from llama_cpp import Llama
File "I:\llama-cpp-python\conda_py310\env\lib\site-packages\llama_cpp_init_.py", line 1, in
from .llama_cpp import *
File "I:\llama-cpp-python\conda_py310\env\lib\site-packages\llama_cpp\llama_cpp.py", line 81, in
_lib = _load_shared_library(_lib_base_name)
File "I:\llama-cpp-python\conda_py310\env\lib\site-packages\llama_cpp\llama_cpp.py", line 72, in _load_shared_library
raise FileNotFoundError(
FileNotFoundError: Shared library with base name 'llama' not found

@sujeendran
Copy link
Contributor Author

@tk-master What are the contents in your I:\llama-cpp-python\conda_py310\env\lib\site-packages\llama_cpp location?

antoine-lizee pushed a commit to antoine-lizee/llama-cpp-python that referenced this pull request Oct 30, 2023
@tk-master
Copy link
Contributor

Idk the usual I guess @sujeendran
image

@sujeendran
Copy link
Contributor Author

@tk-master - Interesting. Mine has libllama.dll instead of llama.dll which was the issue that I was facing. I guess you must have used another compiler to build the package. I have made a small change to look for both files. Can you try now?

@tk-master
Copy link
Contributor

Seems to work, I guess having both those lines to load the .dll doesn't hurt.

@abetlen
Copy link
Owner

abetlen commented Nov 1, 2023

@sujeendran thank you. Yeah having both lines can't hurt, likely an msvc vs mingw difference.

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

Successfully merging this pull request may close these issues.

3 participants