marker
marker copied to clipboard
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\schor\\AppData\\Local\\Temp\\tmpoaply4el.pdf'
Getting this error when trying the gui and i run the marker
I had this same error.
Running marker_gui in an Ananoda environment on Windows 11.
Have you tried the following?
- relocating the pdf file to another directory outside the C:\Users folder
- removing blank spaces from the document name
in marker_app.py
I changed the line 110 from
with tempfile.NamedTemporaryFile(suffix=".pdf") as temp_pdf:
to
with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as temp_pdf:
And it worked
in marker_app.py I changed the line 110 from
with tempfile.NamedTemporaryFile(suffix=".pdf") as temp_pdf:to
with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as temp_pdf:And it worked
I encountered the same problem, according to your way, has solved this problem. I hope the authorities change the code. @motiteux
# Run Marker
temp_pdf_path = os.path.join("C:\\temp", "temp_pdf.pdf")
with open(temp_pdf_path, "wb") as temp_pdf:
temp_pdf.write(in_file.getvalue())
filename = temp_pdf_path
md_text, images, out_meta = convert_pdf(filename, languages, max_pages, ocr_all_pages)
md_text = markdown_insert_images(md_text, images)
# with tempfile.NamedTemporaryFile(suffix=".pdf") as temp_pdf:
# temp_pdf.write(in_file.getvalue())
# temp_pdf.seek(0)
# filename = temp_pdf.name
# md_text, images, out_meta = convert_pdf(filename, languages, max_pages, ocr_all_pages)
# md_text = markdown_insert_images(md_text, images)
i just use another temp path, worked fine
still with the same error
in marker_app.py I changed the line 110 from
with tempfile.NamedTemporaryFile(suffix=".pdf") as temp_pdf:to
with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as temp_pdf:And it worked
Bumping this solution. Worked for me.
with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as temp_pdf:
thanks,it worked!!
in marker_app.py I changed the line 110 from
with tempfile.NamedTemporaryFile(suffix=".pdf") as temp_pdf:to
with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as temp_pdf:And it worked
Works! In my case the code is located in:
<Python Install Location>\Lib\site-packages\marker\scripts\streamlit_app.py line 130
Same problem, same solution