You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to input my s3 pdf file path, but get the error from terminal
Traceback (most recent call last):
File "c:\Users\Demo\Desktop\GitHub\demo\.venv\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "c:\Users\Demo\Desktop\GitHub\demo\.venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 579, in code_to_exec
exec(code, module.__dict__)
File "C:\Users\Demo\Desktop\GitHub\demo\app.py", line 539, in<module>
Flow(
File "C:\Users\Demo\Desktop\GitHub\demo\app.py", line 462, in __init__
self.set_content()
File "C:\Users\Demo\Desktop\GitHub\demo\app.py", line 505, in set_content
).run()
^^^^^
File "c:\Users\Demo\Desktop\GitHub\demo\.venv\Lib\site-packages\streamlit\navigation\page.py", line 293, in run
self._page()
File "C:\Users\Demo\Desktop\GitHub\demo\app.py", line 395, in portfolio
pdf_viewer(
File "c:\Users\Demo\Desktop\GitHub\demo\.venv\Lib\site-packages\streamlit_pdf_viewer\__init__.py", line 93, in pdf_viewer
with open(input, 'rb') as fo:
^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: 'https://demo.com/0.pdf'
importrequestsiftype(input) isnotbytes:
try: # give a try except on original functionwithopen(input, 'rb') asfo:
binary=fo.read()
except:
try: # try to get url file with requestsresponse=requests.get(input)
response.raise_for_status()
binary=response.contentexcept: # if still failed raise error messageraiseTypeError(f"input must be a file path, URL, or binary data. {input} is not a valid file path or URL.")
else:
binary=input
The text was updated successfully, but these errors were encountered:
Thanks! We had an issue opened for this (#33), but we've decided to leave this to the developer because it might require to cache the PDF otherwise at each click the pdf viewer will try to download it.
version information:
problem
I try to input my s3 pdf file path, but get the error from terminal
solution
file location: site-packages/streamlit_pdf_viewer/init.py
modify the code
The text was updated successfully, but these errors were encountered: