Immutable solution version
[Bug]: Can't instantiate abstract class BaseNode with abstract methods
Complete solution
LlamaIndex: Maintainer nerdai confirmed the root cause is a polluted environment: legacy llama-index (0.9.x, llama_index.legacy) installed alongside the v0.10 namespaced packages breaks isinstance checks and class resolution ('Any legacy llama-index lingering in the virtual envs will certainly cause some issues').
The problem
Issue run-llama/llamaindex#10697 (closed, 42 comments): ### Bug Description Any vector store which returns a TextNode to the query method, i get the following error ` File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init pydantic.errorwrappers.ValidationError: 1 validation error for NodeWithScore node Can't instantiate abstract class BaseNode with abstract methods getcontent, getmetadatastr, gettype, hash, setcontent (type=typeerror) ### Version v0.10.3 ### Steps to Reproduce `` VectorStoreIndex.fromvectorstore(vectorstore) engine = clickhousevectorstore().asqueryengine( similaritytop_k=10) response = engine.query(
The verified fix
Maintainer nerdai confirmed the root cause is a polluted environment: legacy llama-index (0.9.x, llamaindex.legacy) installed alongside the v0.10 namespaced packages breaks isinstance checks and class resolution ('Any legacy llama-index lingering in the virtual envs will certainly cause some issues'). Fix: create a fresh virtualenv and install only what you need (python -m venv venv; pip install llama-index; pip install [integration packages]), or pip uninstall llama-index then pip install llama-index --upgrade. Never mix llamaindex.legacy imports with the new llama_index.core structure. Reporter gingerwizard confirmed: 'Resolved for me when i completely cleaned the env.'
Evidence
In gh:run-llama/llamaindex#10697 (https://github.com/run-llama/llamaindex/issues/10697), someone reported: Issue run-llama/llamaindex#10697 (closed, 42 comments): ### Bug Description Any vector store which returns a TextNode to the query method, i get the following error ` File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init pydantic.errorwrappers.ValidationError: 1 validation error for NodeWithScore node Can't instantiate abstract class BaseNode with abstract methods getcontent, getmetadatastr, gettype, hash, setcontent (type=typeerror) ### Version v0.10.3 ### Steps to Reproduce `` VectorStoreIndex.fromvectorstore(vectorstore) engine = clickhousevectorstore().asqueryengine( similaritytopk=10) response = engine.query( The verified resolution from the thread: Maintainer nerdai confirmed the root cause is a polluted environment: legacy llama-index (0.9.x, llamaindex.legacy) installed alongside the v0.10 namespaced packages breaks isinstance checks and class resolution ('Any legacy llama-index lingering in the virtual envs will certainly cause some issues'). Fix: create a fresh virtualenv and install only what you need (python -m venv venv; pip install llama-index; pip install [integration packages]), or pip uninstall llama-index then pip install llama-index --upgrade. Never mix llamaindex.legacy imports with the new llamaindex.core structure. Reporter gingerwizard confirmed: 'Resolved for me when i completely cleaned the env.'
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_gFbv4CjNMMfXKHISJsBHUA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[Bug]: Can't instantiate abstract class BaseNode with abstract methods <span>— Vectle</span></a>