Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionError: [Errno 13] #363

Open
Tinnnitus opened this issue Oct 30, 2023 · 2 comments
Open

PermissionError: [Errno 13] #363

Tinnnitus opened this issue Oct 30, 2023 · 2 comments

Comments

@Tinnnitus
Copy link

Tinnnitus commented Oct 30, 2023

Good afternoon,

I'm trying to run ocr-d and followed the native installation guide via https://ocr-d.de/en/setup. Everything seems to have worked, but when I want to test the native installation I get an error report. Is somebody able to help me here please? I'm testing it on Ubuntu 22.04.02 via wsl on Windows 11. Many thanks in advance!

(venv) flo@flori:~/ocrd_all/data$ ocrd-tesserocr-segment-region -I OCR-D-IMG -O OCR-D-SEG-BLOCK
13:35:27.932 ERROR ocrd.processor.helpers.run_processor - Failure in processor 'ocrd-tesserocr-segment-region'
Traceback (most recent call last):
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/processor/helpers.py", line 131, in run_processor
    processor.process()
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd_tesserocr/recognize.py", line 432, in process
    file_path = self.workspace.save_image_file(
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/workspace.py", line 1062, in save_image_file
    out = self.add_file(
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd_utils/deprecate.py", line 15, in wrapper
    return f(*args, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd_utils/deprecate.py", line 15, in wrapper
    return f(*args, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/workspace.py", line 408, in add_file
    makedirs(local_filename_dir)
  File "/usr/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: 'OCR-D-SEG-BLOCK'
Traceback (most recent call last):
  File "/home/flo/ocrd_all/venv/bin/ocrd-tesserocr-segment-region", line 8, in <module>
    sys.exit(ocrd_tesserocr_segment_region())
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd_tesserocr/cli.py", line 23, in ocrd_tesserocr_segment_region
    return ocrd_cli_wrap_processor(TesserocrSegmentRegion, *args, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/decorators/__init__.py", line 132, in ocrd_cli_wrap_processor
    run_processor(processorClass, mets_url=mets, workspace=workspace, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/processor/helpers.py", line 134, in run_processor
    raise err
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/processor/helpers.py", line 131, in run_processor
    processor.process()
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd_tesserocr/recognize.py", line 432, in process
    file_path = self.workspace.save_image_file(
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/workspace.py", line 1062, in save_image_file
    out = self.add_file(
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd_utils/deprecate.py", line 15, in wrapper
    return f(*args, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd_utils/deprecate.py", line 15, in wrapper
    return f(*args, **kwargs)
  File "/home/flo/ocrd_all/venv/lib/python3.10/site-packages/ocrd/workspace.py", line 408, in add_file
    makedirs(local_filename_dir)
  File "/usr/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: 'OCR-D-SEG-BLOCK'
@kba
Copy link
Member

kba commented Nov 13, 2023

PermissionError: [Errno 13] Permission denied: 'OCR-D-SEG-BLOCK'

Are you sure the permissions in ~/ocrd_all/data are correct? Can you do mkdir foo on the command line?

@Tinnnitus
Copy link
Author

Hey, thank you very much for your response. I can do "mkdir foo" and it creates the folder. I also tried to give permissions with "sudo chmod -R 755" but to no avail. However I am by no means a computer expert, so any advise is very much welcome!
Is it maybe an issue because I am using Ubuntu via Windows Sub System?
Thanks in advance for taking your time, maybe you have another suggestion. Kind regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants