Skip to content

Make opencv-python a pip dependency for Windows. - #317

Closed
clalancette wants to merge 3 commits into
masterfrom
opencv-python-windows-pip
Closed

Make opencv-python a pip dependency for Windows.#317
clalancette wants to merge 3 commits into
masterfrom
opencv-python-windows-pip

Conversation

@clalancette

Copy link
Copy Markdown
Contributor

That way it will get properly installed in both debug
and non-debug versions.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

That way it will get properly installed in both debug
and non-debug versions.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
# python_qt_bindings can't be imported to run or test rqt_graph or
# rqt_py_common.
if sys.platform == 'win32' and args.cmake_build_type == 'Debug':
# There are no Windows debug packages available for opencv-python, so

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't win here...

]
if sys.platform == 'win32' and not args.cmake_build_type == 'Debug':
pip_dependencies += [
'opencv-python',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will opencv-python from pypi work with our opencv binary?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A follow up question would be why doesn't our opencv binary include opencv-python?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could potentially fix the debug builds as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will opencv-python from pypi work with our opencv binary?

Yes and no. opencv-python is its own compiled version of the library, and doesn't use our version. Because of this, there is a potential of version drift between them (we currently package OpenCV 3.4, while opencv-python from pip is currently 4.10).

A follow up question would be why doesn't our opencv binary include opencv-python?

Yeah, maybe that is the right way to go. I guess we'd have to figure out how to make that compile happen, and then we'd also have to figure out how to tell users to unpack properly to C:\python37 and/or setup PYTHONPATH. @mjcarroll , up for a challenge? :).

That could potentially fix the debug builds as well.

Only if you can include both the debug and release .pyd files in the same tarball. Can you?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if you can include both the debug and release .pyd files in the same tarball. Can you?

I believe there's some dark magic in the CI scripts to uninstall and reinstall python extensions on Windows so the correct Debug or Release library is used.

@clalancette

Copy link
Copy Markdown
Contributor Author

Giving up on this one, we'll decide whether to do this another day.

@clalancette
clalancette deleted the opencv-python-windows-pip branch February 12, 2024 21:57
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.

3 participants