OSError: exception: access violation reading 0x0000000000000000

Open Beginner friendly
#1,903 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
ai, backend

Research direction

The issue shows a workaround: importing llama_cpp before pandas avoids an access violation on Windows. Start by reproducing the error with the given code snippet, then examine the import order in the llama-cpp-python and pandas initialization code. Look for shared libraries or memory conflicts. Verify the fix by running the corrected import order and checking that the Llama model loads without error.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
10.6k
Forks
1.5k
Avg merge
23m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from abetlen/llama-cpp-python

All issues in abetlen/llama-cpp-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.