Code Monkey home page Code Monkey logo

Comments (5)

giswqs avatar giswqs commented on June 25, 2024

Steps to reproduce the error:

conda install -c conda-forge pointpats
pip check

from pointpats.

ljwolf avatar ljwolf commented on June 25, 2024

Hi @giswqs! The odd thing is that, I think, the package does not require opencv. It's a "soft dependency," being that one function attempts to import it, but if the package is not provided, then the function simply errors. This pattern is used elsehwere in python (such as pandas.read_excel) and is pretty common... I will need to read up on how pip check works in order to resolve the issue.

from pointpats.

giswqs avatar giswqs commented on June 25, 2024

The opencv-contrib-python package is listed on the requirements.txt, which is causing the issue. If you remove it from requirements.txt and check the dependency in a module and prompt users to install them if needed, that should solve the issue.

from pointpats.

giswqs avatar giswqs commented on June 25, 2024

It appears that the only function using opencv is minimum_rotated_rectangle(). Since the function already provides error handling, I think opencv-contrib-python can be safely removed from requirements.txt. Otherwise, it will cause issues for all pysal downstream packages on conda-forge with pip check. Also, opencv-contrib-python is quite a large package (150MB). including such a large package as a required dependency that is only used by one function is not ideal.

try:
from cv2 import minAreaRect, boxPoints
except ModuleNotFoundError:
raise ModuleNotFoundError("OpenCV2 is required to use this function.")

from pointpats.

martinfleis avatar martinfleis commented on June 25, 2024

I believe that this was resolved by #82.

from pointpats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.