gabacode / chatPDF

Load a PDF file and ask questions via llama_index and GPT
93 stars 35 forks source link

a simple issue #3

Closed doctore2015 closed 1 year ago

doctore2015 commented 1 year ago

D:\Users\doctore\Documents\GitHub\chatPDF>python3 main.py Traceback (most recent call last): File "D:\Users\doctore\Documents\GitHub\chatPDF\main.py", line 17, in openai.api_key = os.environ["OPENAI_API_KEY"] File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64qbz5n2kfra8p0\lib\os.py", line 680, in getitem__ raise KeyError(key) from None KeyError: 'OPENAI_API_KEY'

I followed all the instrcution but came up this

try to fix but do not work

gabacode commented 1 year ago

Hello @doctore2015. Please check this comment, let me know if that helps.

gabacode commented 1 year ago

Duplicate of #2

doctore2015 commented 1 year ago

this is my root image

and this where goes wrong

image

doctore2015 commented 1 year ago

somehow i fix my first issue, however here comes a new one as follow:

i make a copy to my c: drive and exe it , hopefully there is no problem here.

File "C:\Users\doctore\chatPDF\main.py", line 99, in ask(file) File "C:\Users\doctore\chatPDF\main.py", line 34, in ask PDFReader = download_loader("PDFReader") File "C:\Users\doctore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\llama_index\readers\download.py", line 124, in download_loader library_rawcontent, = _get_file_content(loader_hub_url, "/library.json") File "C:\Users\doctore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\llama_index\readers\download.py", line 24, in _get_file_content resp = requests.get(loader_hub_url + path) File "C:\Users\doctore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\api.py", line 73, in get return request("get", url, params=params, kwargs) File "C:\Users\doctore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "C:\Users\doctore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 587, in request resp = self.send(prep, send_kwargs) File "C:\Users\doctore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 701, in send r = adapter.send(request, kwargs) File "C:\Users\doctore\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\adapters.py", line 565, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /emptycrown/loader-hub/main/loader_hub/library.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000209980F2CE0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))

gabacode commented 1 year ago

@doctore2015 it seems that you're having network issues that don't let you download the loader from GitHub. Check your firewall to be sure!