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

Explicit Orange3 import #189

Closed
woutdenolf opened this issue Mar 14, 2022 · 0 comments · Fixed by #190
Closed

Explicit Orange3 import #189

woutdenolf opened this issue Mar 14, 2022 · 0 comments · Fixed by #190

Comments

@woutdenolf
Copy link
Contributor

I have an installation which only has orange-canvas an orange-base-widget and it complains about Orange3 not being installed

----------------------- DistributionNotFound Exception ------------------------
Traceback (most recent call last):
  File "/home/denolf/dev/orange-canvas-core/orangecanvas/application/canvasmain.py", line 1901, in browse_examples
    if self.examples_dialog() == QDialog.Accepted:
  File "/home/denolf/dev/orange-canvas-core/orangecanvas/application/canvasmain.py", line 1846, in examples_dialog
    tutors = examples.workflows(config.default)
  File "/home/denolf/dev/orange-canvas-core/orangecanvas/application/examples.py", line 46, in workflows
    for ep in examples_entry_points():
  File "/home/denolf/dev/orange-widget-base/orangewidget/workflow/config.py", line 81, in examples_entry_points
    dist=pkg_resources.get_distribution("Orange3"))
  File "/users/denolf/virtualenvs/ewoks/ubuntu_20_04/py38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 471, in get_distribution
    dist = get_provider(dist)
  File "/users/denolf/virtualenvs/ewoks/ubuntu_20_04/py38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 347, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/users/denolf/virtualenvs/ewoks/ubuntu_20_04/py38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/users/denolf/virtualenvs/ewoks/ubuntu_20_04/py38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'Orange3' distribution was not found and is required by the application
-------------------------------------------------------------------------------

So I guess the best way is to capture pkg_resources.DistributionNotFound and return an empty list here:

default_ep = pkg_resources.EntryPoint(
"Orange3", "Orange.canvas.workflows",
dist=pkg_resources.get_distribution("Orange3"))

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