llama-cpp-python icon indicating copy to clipboard operation
llama-cpp-python copied to clipboard

OSError: exception: access violation reading 0x0000000000000000

Open andretisch opened this issue 10 months ago • 3 comments

OS: Windows 10 x64 Python 3.11 x64 pandas 2.2.3 llama-cpp-python 0.3.6

import pandas as pd

from llama_cpp import Llama

Llama(model_path='models/user-bge-m3-q4_k_m.gguf')

OSError: exception: access violation reading 0x0000000000000000

Image

Solution: Load pandas after llama_cpp:

from llama_cpp import Llama
import pandas as pd

Llama(model_path='models/user-bge-m3-q4_k_m.gguf')

Image

andretisch avatar Jan 24 '25 11:01 andretisch

hello i dont use pandas in my project it still occurs, is there any solution alternatively?

guney45 avatar Mar 04 '25 16:03 guney45

+1 Also encountering this error on Windows (10/11) since 0.3.8. As @guney45, I don't use pandas too and calls llama_cpp before any other package.

Edit : My bad ... After further investigations, I discovered that I indeed use pandas : llama_cpp is actually loaded first, but inside a module called after other packages that implicitly depends on pandas. Importing first llama_cpp in my main script works fine and solved the issue.

Thanks for the tip @andretisch !

Woolverine94 avatar Mar 13 '25 23:03 Woolverine94

At first, I also did not use Panda, and got the same situation. I have followed @andretisch's tip. But it is still not working.

Image Image

khoatran02 avatar Sep 03 '25 06:09 khoatran02