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

Importing csrank causes error without optional theano installed #137

Closed
kiudee opened this issue Jun 8, 2020 · 2 comments · Fixed by #138
Closed

Importing csrank causes error without optional theano installed #137

kiudee opened this issue Jun 8, 2020 · 2 comments · Fixed by #138
Assignees
Labels
bug Something isn't working Priority: Critical

Comments

@kiudee
Copy link
Owner

kiudee commented Jun 8, 2020

Simply running

import csrank

after installing csrank from pip without any optional dependencies, results in the following error:

csrank.util.MissingExtraError: Could not import the optional dependency theano. Please install it or specify the "probabilistic" extra when installing this package.

This should definitely not happen.

Version: 1.2.0

@kiudee kiudee added bug Something isn't working Priority: Critical labels Jun 8, 2020
@timokau timokau self-assigned this Jun 8, 2020
@timokau
Copy link
Collaborator

timokau commented Jun 8, 2020

Looks like this has been the case since optional dependencies were introduced. The problem is that we re-export everything at the top level, so import csrank will actually evaluate all the code. This will be solved by #115, though we probably want a faster intermediate solution.

@timokau
Copy link
Collaborator

timokau commented Jun 8, 2020

I see two options:

  1. make the optional imports more lazy, i.e. only import at usage and not at module import
  2. make the optional imports mandatory again

(2) is probably best for a hotfix 1.2.1.

timokau added a commit to timokau/cs-ranking that referenced this issue Jun 8, 2020
timokau added a commit to timokau/cs-ranking that referenced this issue Jun 8, 2020
kiudee added a commit that referenced this issue Sep 14, 2020
kiudee added a commit that referenced this issue Sep 14, 2020
kiudee added a commit that referenced this issue Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: Critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants