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

[BUG] setting openslide backend without installing openslide raises unhelpful error #170

Closed
kaczmarj opened this issue Jul 26, 2023 · 0 comments · Fixed by #177
Closed

Comments

@kaczmarj
Copy link
Member

running a fresh install of wsinfer and attempting to use openslide backend raises an error.

pip install wsinfer==0.4.0
wsinfer --backend=openslide run --help

here is the error traceback:

INFO:wsinfer.wsi:Setting backend to openslide
Traceback (most recent call last):
  File "/tmp/foo/venv/bin/wsinfer", line 8, in <module>
    sys.exit(cli())
  File "/tmp/foo/venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/tmp/foo/venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/tmp/foo/venv/lib/python3.10/site-packages/click/core.py", line 1685, in invoke
    super().invoke(ctx)
  File "/tmp/foo/venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmp/foo/venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/tmp/foo/venv/lib/python3.10/site-packages/wsinfer/cli/cli.py", line 44, in cli
    set_backend(backend)
  File "/tmp/foo/venv/lib/python3.10/site-packages/wsinfer/wsi.py", line 57, in set_backend
    WSI = openslide.OpenSlide
NameError: name 'openslide' is not defined

in the wsi.py file and set_backend function, we should test if openslide is available before setting the backend. if it is not available, we should fail loudly and tell the user to install openslide-python if they want to use openslide backend. it is possible that the user has already installed openslide-python but it cannot be imported because it cannot find libopenslide (the compiled library). we should add a debug log message if openslide-python is installed but libopenslide cannot be installed

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

Successfully merging a pull request may close this issue.

1 participant