Skip to content

Failed to load shared library #208

@teristam

Description

@teristam

I compiled and installed the latest code (0.1.5) in Windows 11 with Python 3.10.11 and CUDA 11.8. The compilation with cuBLAS flag and installation were successful. When importing the module via from llama_cpp import Llama, python reported

Failed to load shared library 'C:\Users\teristam\Anaconda3\envs\textgen\Lib\site-packages\llama_cpp\llama.dll': 
Could not find module 'C:\Users\teristam\Anaconda3\envs\textgen\Lib\site-packages\llama_cpp\llama.dll' (or one of its dependencies). Try using the full path with constructor syntax.

But when I change

return ctypes.CDLL(str(_lib_path))

to ctypes.CDLL(str(_lib_path),winmode=0), the dll is able to load succesfully. It may be related to a bug in ctype in Windows:

https://stackoverflow.com/questions/59330863/cant-import-dll-module-in-python/64472088#64472088
https://bugs.python.org/issue42114

Metadata

Metadata

Assignees

No one assigned

    Labels

    windowsA Windoze-specific issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions