marker icon indicating copy to clipboard operation
marker copied to clipboard

PermissionError: [Errno 13] Permission denied: 'C:\\Users\\schor\\AppData\\Local\\Temp\\tmpoaply4el.pdf'

Open Schorakbi opened this issue 1 year ago • 5 comments

Getting this error when trying the gui and i run the marker

image

Schorakbi avatar Aug 22 '24 11:08 Schorakbi

I had this same error.

Running marker_gui in an Ananoda environment on Windows 11.

qwinsi avatar Aug 22 '24 16:08 qwinsi

Have you tried the following?

  • relocating the pdf file to another directory outside the C:\Users folder
  • removing blank spaces from the document name

G999n avatar Aug 25 '24 15:08 G999n

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

motiteux avatar Sep 01 '24 19:09 motiteux

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

JinCheng666 avatar Sep 02 '24 07:09 JinCheng666

# 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

TatamiHermit avatar Sep 09 '24 07:09 TatamiHermit

still with the same error

Schorakbi avatar Oct 10 '24 21:10 Schorakbi

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.

SiIverHusky avatar Oct 24 '24 16:10 SiIverHusky

with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as temp_pdf:

thanks,it worked!!

Akaccia avatar Nov 02 '24 15:11 Akaccia

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

KamilDev avatar Jan 28 '25 05:01 KamilDev

Same problem, same solution

vitlib avatar Jan 29 '25 09:01 vitlib