Open wjwwood opened 3 years ago
Hi. I just found this out as well. The problem is that sipconfig was removed after SIP 4. So the
COMMAND ${PYTHON_EXECUTABLE} -c "import sipconfig; print(sipconfig.Configuration().sip_bin)"
in /python_qt_binding/cmake/sip_helper.cmake fails. However, PyQt and all bindings are already installed when I install it via brew and sip also works. To make rolling build, I removed the error in ros-visualization/qt_gui_core/qt_gui_cpp/src/CMakeLists.txt:
message(STATUS "Python binding generators: ${qt_gui_cpp_BINDINGS}")
if(NOT qt_gui_cpp_BINDINGS)
# message(FATAL_ERROR "No Python binding generator found.")
endif()
After that everything is building and my code works as well as qt-applications (both cpp and py qt-applications). I compiled it on Big Sur.
Is it necessary to actually generate the bindings when building ROS? If it is necessary, the code needs to be migrated to use the newer versions of SIP, i think.
Is it necessary to actually generate the bindings when building ROS? If it is necessary, the code needs to be migrated to use the newer versions of SIP, i think.
It's a good question. Most of the RQt tools are written in Python/PyQt already, so they don't really need the SIP stuff. A quick look around seems to say that we don't actually use the SIP rqt stuff (at least, none of the package.xml files seem to depend on it).
So one way out of this may be to just remove the qt_gui_cpp
stuff completely.
Hey everyone, according to Riverbank Computing version 4 is unsupported, however they provide tar
and zip
files with version 4.19.25. I've attempted to install ROS Galactic on Big Sur and have been unsuccessful in getting qt_gui_cpp
with SIP 4.19.25 to install for another reason:
CMake Error at /usr/local/Cellar/cmake/3.19.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version "3.9")
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.19.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.19.4/share/cmake/Modules/FindPythonLibs.cmake:310 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/qt_gui_cpp/CMakeLists.txt:2 (find_package)
If I come up for a solution to this other python problem then I think maybe we'll need to wrap versions of SIP and other Qt versions within the osrf
brew tap.
EDIT: This was an issue with Xcode command line tools not installed and reinstalling Python through brew
again.
I think that either the possibility for c++ plugins in rqt is removed or that the code is updated to SIP 6. Maybe as @clalancette suggested, this is not really used and could be removed. There have always been a lot of issues with this on mac.
Another work around maybe to use PySide instead of PyQt? I'm not sure about the feasibility of it but I know RViz allows for both.
I just came across this problem.
In my case I'm using Linux, but I'm installing Python packages via pip
rather than via apt-get
in order to use them in a virtual environment.
Running apt-get install python3-sip
installs version 4.19.7 (which includes sipconfig) on the other hand pip3 install sip
installs version 6 which does not include sipconfig.
Similarly it looks like sipconfig is not present also in older versions distributed by pip, e.g. I got same error also using pip3 install sip==4.19.7
.
Following @clalancette suggestion, I resolved the problem by simply ignoring the qt_gui_cpp
and rqt_gui_cpp
packages during the build.
@alsora Can you please elaborate on how to ignore those packages?
@omerts
Just add a file named COLCON_IGNORE
into the qt_gui_cpp
and rqt_gui_cpp
folders...
Or just remove them alltogether from your workspace
A quick look around seems to say that we don't actually use the SIP rqt stuff
The Python bindings are still used in a few of the rqt plugins. The pyside / shiboken bindings do work on macOS, and if the sip bindings are excluded then python_qt_binding
and its dependent packages will build and run.
I've made a couple of non-portable patches to illustrate the changes. brew installs pyside@2
and qt@5
as keg only and I've hardcoded the paths to these in find_package
to get up and running.
python_qt_binding
https://github.com/ros-visualization/python_qt_binding/commit/10b101a972fe480d96daaef19a9c11bd73ba2f31qt_gui_core
https://github.com/ros-visualization/qt_gui_core/commit/162600b7c91c4b7ef979f6d23c97bc05e07d0c61Ensure pyside@2 is in the PYTHONPATH before running rqt:
export PYTHONPATH=$PYTHONPATH:/usr/local/opt/pyside@2/lib/python3.10/site-packages
Here is ROS2 Humble running rqt on macOS Monterey (intel MacPro).
Edit: 2 Sep 2022
python_qt_binding
patch. @srmainwaring If you find a way to clean up those patches, we'd be happy to review them.
Additionally, @ipa-cmh has started working in this area to try to rectify all of the different ways we use Python with Qt. See https://github.com/ros-visualization/python_qt_binding/pull/115 , https://github.com/ros2/rviz/pull/889 , and https://github.com/ros-visualization/python_qt_binding/issues/114 .
@clalancette I've cleaned up the patches and submitted these PRs:
There is an ugly macOS specific work-around for the shiboken generator's include dependency on some Qt components. Depending on the plans / timelines you mention above to streamline the approaches to use Qt Python this may or may not be acceptable as an interim measure.
I'm also running into this on Ubuntu 23.04 (Lunar). Yes, I know it's not a supported distro, but I thought I could at least make people aware.
Temporary solution:
colcon build --packages-skip qt_gui_cpp --packages-skip-by-dep qt_gui_cpp
Looks like QT5 just went EOL anyways. https://en.wikipedia.org/wiki/Qt_version_history
Any progress on this (for macOS)?
When testing ROS 2 Galactic (actually rolling since we haven't forked yet) on macOS Mojave, packages downstream of
python_qt_binding
fail to find SIP like this:This is the version of SIP that is installed by default (as of writing) on a fresh macOS machine:
I'm not sure if it is because we just need something like https://github.com/ros-visualization/python_qt_binding/pull/94 to be merged, or if SIP>=6 is supposed to be used with Qt 6 (we're still using Qt 5 as
qt@5
on macOS, but there's no equivalent for sip that I can find in homebrew).