OCR-D / ocrd-website

Creative Commons Attribution 4.0 International
24 stars 7 forks source link

PermissionError: [Errno 13] #363

Open Tinnnitus opened 1 year ago

Tinnnitus commented 1 year ago

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 commented 12 months ago
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 commented 12 months ago

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!