llama_index: [Bug]: ModuleNotFoundError: No module named 'llama_index.cli.command_line.rag'; 'llama_index.cli.command_line' is not a package
Bug Description
I am getting this error attempting to upgrade a file using llamaindex-cli upgrade-file <file_path>
(venv) PS C:\Users\aaols\PycharmProjects\experiments> llamaindex-cli upgrade-file indexing.py
Traceback (most recent call last):
File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\aaols\PycharmProjects\experiments\venv\Scripts\llamaindex-cli.exe\__main__.py", line 4, in <module>
File "C:\Users\aaols\PycharmProjects\experiments\venv\lib\site-packages\llama_index\cli\command_line.py", line 4, in <module>
from llama_index.cli.command_line.rag import RagCLI, default_ragcli_persist_dir
ModuleNotFoundError: No module named 'llama_index.cli.command_line.rag'; 'llama_index.cli.command_line' is not a package
My llama deps
llama-index==0.10.6
llama-index-agent-openai==0.1.1
llama-index-cli==0.1.2.post1
llama-index-core==0.10.10
llama-index-embeddings-openai==0.1.1
llama-index-legacy==0.9.48
llama-index-llms-openai==0.1.2
llama-index-multi-modal-llms-openai==0.1.1
llama-index-program-openai==0.1.2
llama-index-question-gen-openai==0.1.1
llama-index-readers-file==0.1.3
llama-index-readers-github==0.1.5
llama-index-vector-stores-chroma==0.1.2
llama-index-vector-stores-deeplake==0.1.1
llamaindex-py-client==0.1.13
Version
0.10.6
Steps to Reproduce
run the command llamaindex-cli upgrade-file <file_path> on a file that still has some old, pre v0.10.0 imports in it
Relevant Logs/Tracbacks
No response
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 17 (3 by maintainers)
đ¤
Hey @aaronjolson! Great to see you back with us. I hope all has been going well since our last chat. Letâs dive into this issue and see how we can get it resolved for you.
Based on the error message you provided, it seems like Python is unable to find the module âllama_index.cli.command_line.ragâ. This could be due to several reasons:
In the provided context, there is an import statement for âllama_index.cli.command_line.ragâ at the top of the file:
This suggests that âllama_index.cli.command_line.ragâ is expected to be a module in your project. If youâre encountering a ModuleNotFoundError, I would recommend checking the above points in your project to resolve the issue.
However, based on the LlamaIndex codebase, the module âllama_index.cli.command_line.ragâ does not exist. The correct module seems to be âllama_index.cli.ragâ. You can find this in the llama-index-cli/llama_index/cli/rag/init.py file.
Therefore, you might want to change your import statement to:
Additionally, I noticed that youâre using LlamaIndex version 0.10.6, but the latest version is v0.10.10. It might be beneficial to upgrade to the latest version, as this issue might have been resolved in a newer version.
You can upgrade LlamaIndex by running:
If the issue persists after making these changes, please provide more information about your setup, such as your Python version, operating system, and the exact steps youâre taking when you encounter this error. This will help in diagnosing the problem.
I hope this helps! If you have any other questions, feel free to ask.
Sources
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a đ if this is helpful and đ if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
OK I can confirm it worked within the last 30 seconds LOL. I literally tried a -U llama-index, didnât pick up anything. Tried -U llama-index-core, picked up llama_index_core-0.10.11.post1-py3-none-any.whl, but that didnât fix it. Then -U llama-index again and got 0.10.11. That finally ran upgrade. Thanks.
Proof it works in colab, https://colab.research.google.com/drive/1o9GiupK995a-0UG86716Kli_ZYy3r7wD?usp=sharing
Closing this issue out. For anyone encountering this issue, just run the install above
@logan-markewich Here are my upgraded deps, I had blew away my venv.
still getting