Skip to content

Section 2 part 3 fails with Import not found. #1

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

Open
MadVikingGod opened this issue Sep 24, 2024 · 1 comment
Open

Section 2 part 3 fails with Import not found. #1

MadVikingGod opened this issue Sep 24, 2024 · 1 comment

Comments

@MadVikingGod
Copy link

Issue Overview

When Running Section 2.03 the current setup has errors creating documents. First I found that you are trying to load ./data not ../data, creating a directory not found error.

This uncovered a different error, that llama-index==0.10.37 needs llama-index-readers-file>=0.1.24 or it gets an import error.

Describe your environment

This was setup in codespaces using your setup script.

Steps to Reproduce

  1. Follow section 1 for setting up codespace
  2. Try to run section 2 part 3. Get error: ValueError: Directory ./data does not exist.
  3. Fix that error and run again and get
ImportError                               Traceback (most recent call last)
File /opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:52, in _try_loading_included_file_formats()
     [51](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:51) try:
---> [52](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:52)     from llama_index.readers.file import (
     [53](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:53)         DocxReader,
     [54](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:54)         EpubReader,
     [55](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:55)         HWPReader,
     [56](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:56)         ImageReader,
     [57](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:57)         IPYNBReader,
     [58](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:58)         MarkdownReader,
     [59](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:59)         MboxReader,
     [60](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:60)         PandasCSVReader,
     [61](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:61)         PandasExcelReader,
     [62](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:62)         PDFReader,
     [63](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:63)         PptxReader,
     [64](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:64)         VideoAudioReader,
     [65](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:65)     )  # pants: no-infer-dep
     [66](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:66) except ImportError:

ImportError: cannot import name 'PandasExcelReader' from 'llama_index.readers.file' (/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/readers/file/__init__.py)

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
...
     [89](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:89)     ".xlsx": PandasExcelReader,
     [90](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:90) }
     [91](https://vscode-remote+codespaces-002bglowing-002dwaffle-002d647g4xjpjx36rv.vscode-resource.vscode-cdn.net/opt/conda/envs/lil_llama_index/lib/python3.10/site-packages/llama_index/core/readers/file/base.py:91) return default_file_reader_cls

ImportError: `llama-index-readers-file` package not found

Possible Solution

Fixing the ./data, and doing a pip install --upgrade llama-index-readers-file==0.1.25 + restart of the kernel fixes the issues

@baubakg
Copy link

baubakg commented Oct 23, 2024

The workaround works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants