Open PeterJCLaw opened 2 years ago
I've since noticed that this is somewhat covered in the README, however I encountered this as a result of zoloto
being a transitive dependency several steps away from the project I was exploring. Nothing along the chain had installed an OpenCV instance, making this a rather confusing error.
Perhaps a better approach would be for zoloto
to emit only a warning at import time about the lack of cv2, perhaps including there the explanation, and only fail when it's actually used?
Almost everything in zoloto
depends on OpenCV being installed, it's very difficult to decouple.
I would be interested in working out how viable it would be to add this, especially as it could be installed either through pip
or the system package manager (and generally the latter is better). Perhaps simply catching and re-throwing with a better message?
Re-throwing with a better message would also be an option.
It's not clear to me why you believe that installing opencv's Python bindings via the system package manager is likely a better option? I can see that working for cases where the user is installing all their packages via the system manager, however for users installing into a virtual environment (or indeed using pip
or similar to manage a non-virtual environment) installing from PyPI is usually going to be the more convenient option.
opencv-python-headless
publishes wheels for most architectures, meaning that the chances are that most consumers will be well served by those options.
Perhaps zoloto
should publish itself in system package managers with suitable dependencies configured there for consumers where you expect that that will be important?
opencv-python-headless publishes wheels for most architectures, meaning that the chances are that most consumers will be well served by those options.
Forcing the installation of this statically built wheel is not great on platforms where we need to use a system installation of OpenCV, e.g the Student Robotics kit. It's also worth noting that the SR kit uses the source packages from PyPI
Installing
zoloto
into a fresh virtualenv doesn't install any open cv packages, yet they're needed for it to be used at all.Steps:
(venv) $ pip install -U pip setuptools wheel
(venv) $ pip install zoloto