qurator-spk / sbb_binarization

Document Image Binarization
Apache License 2.0
67 stars 14 forks source link

can't install #24

Closed SB2020-eye closed 3 years ago

SB2020-eye commented 3 years ago

Hi. Running on Windows 10 OS. Using Visual Studio Code.

Running (myenvironmentname) PS C:\users\scott\desktop\python2\sbb_binarization> pip install . I keep getting the following:

Processing c:\users\scott\desktop\python2\sbb_binarization
    ERROR: Command errored out with exit status 1:
     command: 'C:\ProgramData\Anaconda3\envs\myenvironmentname\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Scott\\AppData\\Local\\Temp\\pip-req-build-l7egxsl1\\setup.py'"'"'; __file__='"'"'C:\\Users\\Scott\\AppData\\Local\\Temp\\pip-req-build-l7egxsl1\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Scott\AppData\Local\Temp\pip-pip-egg-info-notlemz5'
         cwd: C:\Users\Scott\AppData\Local\Temp\pip-req-build-l7egxsl1\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Scott\AppData\Local\Temp\pip-req-build-l7egxsl1\setup.py", line 6, in <module>
        with open('./ocrd-tool.json', 'r') as f:
    FileNotFoundError: [Errno 2] No such file or directory: './ocrd-tool.json'
    ----------------------------------------
WARNING: Discarding file:///C:/users/scott/desktop/python2/sbb_binarization. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I'm very new at all this. And my (beginner) language is Python. I don't understand the json stuff. Any help getting this installed would be greatly appreciated. :)

kba commented 3 years ago

We don't develop for Windows, our target system is Ubuntu 18.04. I guess, Windows cannot deal with UNIX-like path like ./ocrd-tool.json.

I would strongly recommnd to either install it inside a Linux VM or to use the ocrd_all Docker images which include sbb_binarization. With the latter option, you only need to install Docker and nothing else.

kba commented 3 years ago

Ah, no, the issue is that ocrd-tool.json in the root repo is a symlink to the actual file and Windows does not support symlinks.

SB2020-eye commented 3 years ago

Thanks, @kba. Just for closure: Is there a way you know of, off the top of your head, I can simply "replace" the symlink? Or otherwise workaround this to install sbb_binarization?

kba commented 3 years ago

You could copy /sbb_binarize/ocrd-tool.json to the root of the repository, that should fix the setup.py problem. But you will probably run into more difficulty on Windows.

cneud commented 3 years ago

Maybe @stefanCCS has an idea? While also not able to successfully install on Windows, it appears he got a little further at least...otherwise you may want to try Docker or WSL.

SB2020-eye commented 3 years ago

I copied /sbb_binarize/ocrd-tool.json to the repository root (and just renamed the file already in the root with the same name), and everything has appeared to install. I gave it a test run once, and sure enough, I received a binarized output. So at least for now: so far, so good! Thank you!!!