alejandro-ao / ask-multiple-pdfs

A Langchain app that allows you to chat with multiple PDFs
1.63k stars 933 forks source link

Not able to run the code #2

Open Vector-9974 opened 1 year ago

Vector-9974 commented 1 year ago

(gitenvt) C:\Users\Work\Desktop\dataProcess\ask-multiple-pdfs>streamlit run app.py Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\Work\Desktop\dataProcess\gitenvt\Scripts\streamlit.exe__main.py", line 4, in File "C:\Users\Work\Desktop\dataProcess\gitenvt\Lib\site-packages\streamlit\init__.py", line 55, in from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator File "C:\Users\Work\Desktop\dataProcess\gitenvt\Lib\site-packages\streamlit\delta_generator.py", line 43, in from streamlit.elements.arrow_altair import ArrowAltairMixin File "C:\Users\Work\Desktop\dataProcess\gitenvt\Lib\site-packages\streamlit\elements\arrow_altair.py", line 36, in from altair.vegalite.v4.api import Chart ModuleNotFoundError: No module named 'altair.vegalite.v4'

This is the error that is coming when running the streamlit run app.py

How to rectify it

dogg223405 commented 1 year ago

I am assuming you are using Win. Search in Explorer the PythonXX/Scripts folder where you have app.py. and add streamlit with the full path in the System Variables.

DrJulioCid commented 1 year ago

Same problem with Delta generator and altair.vegalite Did you solve it?

DrJulioCid commented 1 year ago

Im on Mac BTW

justin-parker commented 1 year ago

from your shell run: pip install altair==4.2.2

source post talking about this bug/fix

Daniel-Trung-Nguyen commented 1 year ago

installing altair fixed the issue for me. But I ran into this error when processing a document ImportError: Could not import tiktoken python package. This is needed in order to for OpenAIEmbeddings. Please install it with pip install tiktoken.

image

rhoconlinux commented 1 year ago

Hi there, Cannot get it work on macos.

`(python394) ╭─rho@MacBook-Pro.local ~/Library/CloudStorage/Dropbox/ask-multiple-pdfs-main
╰─➤ streamlit run app.py

Traceback (most recent call last): File "/Users/rho/.pyenv/versions/3.9.2/bin/streamlit", line 5, in from streamlit.web.cli import main File "/Users/rho/.pyenv/versions/3.9.2/lib/python3.9/site-packages/streamlit/init.py", line 55, in from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator File "/Users/rho/.pyenv/versions/3.9.2/lib/python3.9/site-packages/streamlit/delta_generator.py", line 43, in from streamlit.elements.arrow_altair import ArrowAltairMixin File "/Users/rho/.pyenv/versions/3.9.2/lib/python3.9/site-packages/streamlit/elements/arrow_altair.py", line 36, in from altair.vegalite.v4.api import Chart ModuleNotFoundError: No module named 'altair.vegalite.v4'`

I tryied 4.0.0 4.1 4.2 and 4.2.2 of altair and 1.18.1 and 1.22.1 of streamlit. Allways returns the same thing. Thanks in advance for the help.

prudhvi2934 commented 1 year ago

add 'altair==4.2.2' in requirements.txt and pip install -r requirements.txt. It worked for me, I'm using macOS.