Skip to content
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

[Bug]: No module named 'lightrag.kg.shared_storage' #1031

Open
2 tasks
thistleknot opened this issue Mar 8, 2025 · 13 comments
Open
2 tasks

[Bug]: No module named 'lightrag.kg.shared_storage' #1031

thistleknot opened this issue Mar 8, 2025 · 13 comments
Labels
bug Something isn't working

Comments

@thistleknot
Copy link

thistleknot commented Mar 8, 2025

Do you need to file an issue?

  • I have searched the existing issues and this bug is not already filed.
  • I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

windows
python 3.10
pip install lightrag-hku
lightrag-hku 1.2.3

Setup and Imports

import os
import asyncio
import nltk
from nltk.corpus import brown
from lightrag import LightRAG, QueryParam
from lightrag.llm.ollama import ollama_model_complete, ollama_embed
from lightrag.kg.shared_storage import initialize_pipeline_status
from lightrag.utils import setup_logger


ModuleNotFoundError Traceback (most recent call last)
Cell In[6], line 10
8 from lightrag import LightRAG, QueryParam
9 from lightrag.llm.ollama import ollama_model_complete, ollama_embed
---> 10 from lightrag.kg.shared_storage import initialize_pipeline_status
11 from lightrag.utils import setup_logger
13 # Set up logging

ModuleNotFoundError: No module named 'lightrag.kg.shared_storage'

Steps to reproduce

No response

Expected Behavior

No response

LightRAG Config Used

Paste your config here

Logs and screenshots

No response

Additional Information

  • LightRAG Version:
  • Operating System:
  • Python Version:
  • Related Issues:
@thistleknot thistleknot added the bug Something isn't working label Mar 8, 2025
@b-d055
Copy link

b-d055 commented Mar 9, 2025

I'm also getting this error on MacOS, python 3.10 using pip install lightrag-hku

@b-d055
Copy link

b-d055 commented Mar 9, 2025

Looks like it's because of the change between 1.2.3 and 1.2.4, - pipy does not yet have 1.2.4, so I've reverted to using 1.2.3 example

@thistleknot
Copy link
Author

thistleknot commented Mar 9, 2025 via email

@b-d055
Copy link

b-d055 commented Mar 9, 2025

@thistleknot yeah - if you look at the diff I linked, shared_storage wasn't introduced until 1.2.4, which is not available via pip yet. I think they need to update their example to be backward-compatible.

@thistleknot
Copy link
Author

thistleknot commented Mar 9, 2025

I'm confused. Does this mean I must be mistaken? I know I did a pip install whatever hku version they had, then after the error tried to install from source... and then did a pip list installed = 1.2.3 so do I install 1.2.4?

@b-d055
Copy link

b-d055 commented Mar 9, 2025

@thistleknot I'm not sure what you think you are mistaken on - You have 1.2.3 installed (via pip as you say). However, you're using code (probably from their examples) which makes uses of 1.2.4 features.

You can see in pipy that 1.2.4 isn't available via pip yet.

To get their new examples to work you can try building form source, but I haven't been able to get that to work in my environment yet.

Like I said, I just stuck to examples which were compatible with v1.2.3. You can explore those here.

I'm sure they'll release v1.2.4 via pip soon but I don't know how that process works.

@thistleknot
Copy link
Author

thistleknot commented Mar 9, 2025 via email

@b-d055
Copy link

b-d055 commented Mar 9, 2025

Yes, but you said

and then did a pip list installed = 1.2.3

Which means you don't have 1.2.4 installed.

I can't help you here since I have 1.2.3 installed from pipy and switched to just using v1.2.3 compatible APIs (per comments above) - perhaps you need to do an uninstall/fresh install from github? Make sure you're using tag v1.2.4

@thistleknot
Copy link
Author

There was a misunderstanding

I left out the fact I did a pip install -e .

But i did after pypi install

I only showed what was installed after

@xxrsdax
Copy link

xxrsdax commented Mar 12, 2025

cd LightRAG
pip install -e .
python .\examples\lightrag_ollama_demo.py

Traceback (most recent call last):
File "D:\develop\code\LightRAG\examples\lightrag_ollama_demo.py", line 8, in
from lightrag import LightRAG, QueryParam
ModuleNotFoundError: No module named 'lightrag'

@kiritbasu
Copy link

I'm having the same problem.
I downloaded the source for v1.2.5 and did a pip install -e .
can also confirm that pip list shows me lightrag-hku 1.2.5 /content/LightRAG/LightRAG-1.2.5
I am also able to import a bunch of other modules just fine e.g. from lightrag import LightRAG, QueryParam

however from lightrag.kg.shared_storage import initialize_pipeline_status does not work, it always fails with

ModuleNotFoundError: No module named 'lightrag.kg.shared_storage'

@kiritbasu
Copy link

I'm having the same problem. I downloaded the source for v1.2.5 and did a pip install -e . can also confirm that pip list shows me lightrag-hku 1.2.5 /content/LightRAG/LightRAG-1.2.5 I am also able to import a bunch of other modules just fine e.g. from lightrag import LightRAG, QueryParam

however from lightrag.kg.shared_storage import initialize_pipeline_status does not work, it always fails with

ModuleNotFoundError: No module named 'lightrag.kg.shared_storage'

I was able to fix the issue, the problem was an older global lightrag pip package that was already present vs the package in the current venv.

@GTimothee
Copy link

GTimothee commented Mar 13, 2025

I think you should deploy the last version to pypi asap, as the main example in the README does not seem work without it.

@thistleknot if you comment the code for initialize_pipeline_status and logging it should work, as a workaround while your real problem (installing from source) is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants