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

Avoid loading OpenCV when not needed #17

Closed
wants to merge 1 commit into from
Closed

Conversation

AdeelH
Copy link

@AdeelH AdeelH commented Jan 4, 2021

from mask_to_polygons.processing import buildings

causes cv2 to be imported, and for that to succeed, you need a number of other packages/libraries installed. Example errors:

from .cv2 import * ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
from .cv2 import * ImportError: libGL-2.0.so.0: cannot open shared object file: No such file or directory
from .cv2 import * ImportError: libSM-2.0.so.0: cannot open shared object file: No such file or directory

This is too much hassle if one is only interested in using polygons and not buildings.

This PR moves the above import statement, so that it is only run if the user wants to use buildings. It does the same for polygons for consistency.

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 this pull request may close these issues.

1 participant