ros-visualization / python_qt_binding Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://wiki.ros.org/python_qt_binding
License: BSD 3-Clause "New" or "Revised" License
Home Page: http://wiki.ros.org/python_qt_binding
License: BSD 3-Clause "New" or "Revised" License
followed ROS wiki installation for Archlinux, almost goes well. but when I try call
rosrun rqt_graph rqt_graph
got AttributeError: 'module' object has no attribute '__import__'
finally I found my Python2.7.11 work fine with __builtin__
, but the try-except in binding_helper.py
has no exception for this import builtins
. I'm not a python programmer, so just comment it, and add import line manually.
On Arch linux (PySide2 version 5.13.2), the variables PYSIDE_LIBRARY
and PYSIDE_INCLUDE_DIR
are not set, which leads to build failures like ros-visualization/qt_gui_core#142.
Setting PYSIDE_INCLUDE_DIR
as CMake argument is a workaround, but not a clean solution.
A proper fix could look like FreeCAD/FreeCAD@3939e45.
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:
Starting >>> qt_gui_cpp
--- stderr: qt_gui_cpp
CMake Warning at /Users/william/ros2_rolling/install/python_qt_binding/share/python_qt_binding/cmake/sip_helper.cmake:27 (message):
SIP binding generator NOT available.
Call Stack (most recent call first):
src/qt_gui_cpp_sip/CMakeLists.txt:56 (include)
CMake Error at src/CMakeLists.txt:10 (message):
No Python binding generator found.
---
Failed <<< qt_gui_cpp [2.72s, exited with code 1]
This is the version of SIP that is installed by default (as of writing) on a fresh macOS machine:
macos-10:ros2_rolling william$ brew info sip
sip: stable 6.0.3 (bottled), HEAD
Tool to create Python bindings for C and C++ libraries
https://www.riverbankcomputing.com/software/sip/intro
/usr/local/Cellar/sip/6.0.3_1 (708 files, 10.7MB) *
Poured from bottle on 2021-04-14 at 16:26:19
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/sip.rb
License: GPL-2.0-only or GPL-3.0-only
==> Dependencies
Required: [email protected] ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 31,588 (30 days), 79,774 (90 days), 258,068 (365 days)
install-on-request: 7,641 (30 days), 12,754 (90 days), 32,176 (365 days)
build-error: 0 (30 days)
macos-10:ros2_rolling william$ brew search sip
==> Formulae
baresip libexosip libosip sip ✔ sipcalc sipp sipsak sofia-sip
==> Casks
homebrew/cask/sip
I'm not sure if it is because we just need something like #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).
I was working on ros2/rviz#889 and I have found a couple of issues with qt python integration, especially dependencies. I was looking into creating python bindings for rviz only with PySide2. No I was wondering how to resolve dependencies and turns out there is no key for pyside2 is not in rosdistro but partially in python_qt5_bindings. This all seems kind of unorganised and super hard if you want to create bindings that only support one of the to binding generators.
pyside2 in rosdistro:
The most essential packages python3-pyside2.qtcore, python3-pyside2.qtgui and python3-pyside2.qtwidgets are not installed by libpyside2-dev, libshiboken2-dev or shiboken in rosdistro. python-pyside2 does not even exist in Ubuntu.
python-qt5-bindings:
arch: [python2-pyqt5]
debian:
buster: [pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-sip-dev, qtbase5-dev]
jessie: [pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-sip-dev, qtbase5-dev]
stretch: [pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-sip-dev, qtbase5-dev]
fedora: [python-qt5-devel, sip]
freebsd: [py27-qt5]
gentoo: ['dev-python/PyQt5[gui,widgets]']
nixos: [pythonPackages.pyqt5]
openembedded: ['${PYTHON_PN}-pyqt5@meta-qt5']
opensuse: [python2-qt5-devel, python2-sip-devel]
slackware: [PyQt5]
ubuntu:
artful: [pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-sip-dev]
bionic: [pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-sip-dev]
wily: [libpyside2-dev, libshiboken2-dev, pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-pyside2, python-sip-dev, shiboken2]
xenial: [libpyside2-dev, libshiboken2-dev, pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-pyside2, python-sip-dev, shiboken2]
yakkety: [libpyside2-dev, libshiboken2-dev, pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-pyside2, python-sip-dev, shiboken2]
zesty: [pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python-sip-dev]
By changing to the following we would at least install the same libraries for pyqt and pyside on Ubuntu:
[libpyside2-dev, libshiboken2-dev, pyqt5-dev, python-pyqt5, python-pyqt5.qtsvg, python3-pyside.qtcore, python3-pyside.qtdbus, python3-pyside.qtdesigner, python3-pyside.qtgui, python3-pyside.qthelp, python3-pyside.qtnetwork, python3-pyside.qtprintsupport, python3-pyside.qttest, python3-pyside.qtwidgets, python3-pyside.qtxml, python3-pyside.qtsvg, python-sip-dev, shiboken2]
Interoperability of PyQt and PySide:
Additionally, why are we not using QtPy(https://github.com/spyder-ide/qtpy) (MIT LICENSE), which has much better support for interoperability between pyside and pyqt, than just replacing names, especially for edge cases. There are also ubuntu/debian binaries in universe.
Qt for Python support is super shady and not well organised. It is very hard to understand which systemdeps to reference to install what. In addition python_qt_bindings will install both pyside2 and pyqt5. Generally, I would rather like to see an approach similar to the rmw's where we have a default and the option to install and use the the other.
The pre-built package for ROS melodic is outdated / not on the kinetic-devel branch.
python_qt_binding has been fixed for recent pyqt versions, thanks for that, however it has been done in a way that calls 'qmake-qt4' (instead of just 'qmake') which seems to be an invention of some distributions ( seen e.g. on https://wiki.archlinux.org/index.php/Qt#Installation and https://wiki.archlinux.org/index.php/Qt#Default_Qt_toolkit ) and that I don't have.
I am not sure how this should be fixed, archlinux wiki mentions a QT_SELECT environment variable, so maybe just calling 'qmake' with this variable set would work.
See https://pypi.org/project/python_qt_binding/
Last update 2016, does not reflect the changes for Qt5
At least for shiboken2
v5.13.0, cmake file set target Shiboken2::shiboken2
, not variable SHIBOKEN_BINARY
any more.
In shiboken_helper.cmake
, we should detect and then choose to use ${SHIBOKEN_BINARY}
or Shiboken2::shiboken2
correspondingly.
Workaround for users with this issue: change ${SHIBOKEN_BINARY}
to Shiboken2::shiboken2
in shiboken_helper.cmake
.
On Fedora 35 build of qt_gui_cpp
fails with this error:
CMake Error:
Running
'/usr/bin/ninja-build' '-C' '/home/eaglesemanation/Documents/Packages/ros2_galactic/build/qt_gui_cpp' '-t' 'recompact'
failed with:
ninja: error: build.ninja:673: bad $-escape (literal $ must be written as $$)
That is caused by hard-coded Make variable $(MAKE)
in sip_helper.cmake. If I change it to make
everything works correctly, but I'm not sure if it's a good solution.
On my system, CMake defaults to Ninja generator because I have defined environment variable CMAKE_GENERATOR=Ninja
. If it's not supported, it should probably be mentioned in docs.
I'm not sure if this is the right place but I want to report it somewhere ...
On Ubuntu Trusty 14.04, PyQt4 is available for python 2.7 (the default), while PyQt5 is only available for python 3.4 (package python3-pyqt5).
Since the default python version is used, no pyqt5 package is found
[ 62%] Running SIP generator for rviz_sip Python bindings...
Traceback (most recent call last):
File "/home/ros/ros_upstream/src/python_qt_binding/cmake/sip_configure.py", line 8, in
from PyQt5 import QtCore
ImportError: No module named PyQt5
I just don't know why it has to depend on catkin
& rosbuild
. If it is not necessary we can make it separate from ROS
. I think it would be useful especially after having looked at PySide that doesn't handle .ui file well.
A few missing documents:
python_qt_binding.loadUi
should obligate the 3rd arg, since PySide
binding requires the 3rd arg in order to incorporate custom widget classes, whereas PyQt
doesn't (Related discussion)QT_BINDING
, QT_BINDING_MODULES
, QT_BINDING_VERSION
) missing docsip_configure.py
currently relies on pyqtconfig
which is deprecated since pyqt4
4.10 (cf. the official documentation), and is likely to be removed (unless pyqt4
was packaged with the legacy script, more information here).
This was detected while trying to compile rviz
on Arch Linux with pyqt4
4.11 (cf. ros-visualization/rviz#785), since pyqtconfig
is no longer available (cf. this bug report).
This update could go to an indigo
branch, based on the pyqt4
versions of targeted Ubuntu distributions.
Well, the title says it all, there is no information at all on the project page. At least a summary, quick example and link to http://wiki.ros.org/python_qt_binding is necessary.
Greetings,
Would you be able to take a look at this comment on this issue? We ran into a snag on arch linux with the code in sip_configure.py
.
Compiling ros-melodic-rviz
failed when trying to find the sip PyQt5 bindings, and installing the python2
variant of the package was a successful workaround. We've been updating everything to python3
, so I looked into what was going on, as we don't really want to keep a package on python2
as a solution.
It looks like the file location for sip files changes. If you go to each of these, scroll down, and click "view the file list", you'll see the difference:
python2-pyqt5
: usr/share/sip/PyQt5/
python-pyqt5
: usr/lib/python3.8/site-packages/PyQt5/bindings
In searching for the latter directory via google, I only get hits for arch linux. I'm not familiar with pyqt5 or sip; do you know where I could check the canonical install directory? I'm thinking either:
At the moment one needs to modify the `sys' module to select a specific Qt binding or to alter the binding order. I think it would be beneficial to also provide a way to change the Qt binding via environment variable.
E.g.
export PYTHON_QT_BINDING=pyside
./run.py
An entry "Activate" appears when the last plugin is closed. After that the menu never changes again, e.g. it doesn't show new entries for opened plugins anymore.
This is related to the transition to Qt 5 in #30. It happens with PyQt as well as PySide.
As a workaround the menu can hold an invisible action.
I'm super newbie to Linux. I am trying to install Ros Lunar on an old 32 bit computer with Lubuntu on
I get this message error
`Processing catkin package: 'qt_gui_cpp'
==> Building with env: '/home/theo/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/home/theo/ros_catkin_ws/build_isolated/qt_gui_cpp'
==> make -j2 -l2 in '/home/theo/ros_catkin_ws/build_isolated/qt_gui_cpp'
[ 83%] Built target qt_gui_cpp
[ 88%] Running SIP generator for qt_gui_cpp_sip Python bindings...
Traceback (most recent call last):
File "/home/theo/ros_catkin_ws/install_isolated/share/python_qt_binding/cmake/sip_configure.py", line 9, in <module>
from PyQt5 import QtCore
ImportError: No module named PyQt5
src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/build.make:89: recipe for target 'sip/qt_gui_cpp_sip/Makefile' failed
make[2]: *** [sip/qt_gui_cpp_sip/Makefile] Error 1
CMakeFiles/Makefile2:374: recipe for target 'src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all' failed
make[1]: *** [src/qt_gui_cpp_sip/CMakeFiles/libqt_gui_cpp_sip.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
<== Failed to process package 'qt_gui_cpp':
Command '['/home/theo/ros_catkin_ws/install_isolated/env.sh', 'make', '-j2', '-l2']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/theo/ros_catkin_ws/build_isolated/qt_gui_cpp && /home/theo/ros_catkin_ws/install_isolated/env.sh make -j2 -l2
`
Tried to both install PyQt5 using pip command and using alien to turn the .tar.bs into a .deb package.
What directory should I search the package in?
Thanks
Mind releasing this repo into Noetic? It looks like all dependencies have been released. It looks like 175 other repos need python_qt_binding
to be released.
command ran: rosrun rqt_graph rqt_graph
error:
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_gui/ros_plugin_provider.py", line 83, in load raise e ImportError: cannot import name QGraphicsPathItem
error originates from here:
File "/opt/ros/kinetic/lib/python2.7/dist-packages/qt_dotgraph/edge_item.py", line 32, in <module> from python_qt_binding.QtGui import QBrush, QGraphicsPathItem, QGraphicsPolygonItem, QGraphicsSimpleTextItem, QPainterPath, QPen, QPolygonF ImportError: cannot import name QGraphicsPathItem
PyQt4 has two methods on QtCore to help one futz around in the interpreter / in pdb. PySide lacks that functionality, and doesn't install any input hooks at all.
I propose that the code checks for these two methods, and if they don't exists, create them as lambdas that do nothing.
Something like:
dummynames = ['pyqtRemoveInputHook', 'pyqtRestoreInputHook']
for m in dummynames:
if not hasattr(QtCore, m):
setattr(QtCore, m, lambda: None)
after the import goes well would suffice.
See http://pyqt.sourceforge.net/Docs/PyQt4/qtcore.html#pyqtRemoveInputHook for more info.
This isn't a high priority, just a suggestion.
Currently python_qt_binding
is only at 0.2.14 on PyPI, meaning python3 Qt apps cannot have it as an automatically installed dependency when installing from pip. Would it be possible to update the package version available on PyPI to fix this?
Central question: Has Shiboken2/PySide2 ever worked on Kinetic/Xenial?
Running rqt with PySide leads to:
$ rqt -b pyside
QtBindingHelper using pyside
PluginManager._discover() using cached plugin discovery information
Segmentation fault (core dumped)
Backtrace in gdb:
(gdb) r /opt/ros/kinetic/bin/rqt -b pyside
Starting program: /usr/bin/python /opt/ros/kinetic/bin/rqt -b pyside
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdee5a700 (LWP 3077)]
QtBindingHelper using pyside
PluginManager._discover() force discovery of plugins
RospkgPluginProvider._find_plugins() crawling for plugins of type 'qt_gui'
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffd7a0e2c2 in QBasicAtomicInteger<int>::load() const ()
from /home/hermann/rosws/devel_isolated/qt_gui_cpp/lib/python2.7/dist-packages/qt_gui_cpp/libqt_gui_cpp_shiboken.so
(gdb) bt
#0 0x00007fffd7a0e2c2 in QBasicAtomicInteger<int>::load() const ()
from /home/hermann/rosws/devel_isolated/qt_gui_cpp/lib/python2.7/dist-packages/qt_gui_cpp/libqt_gui_cpp_shiboken.so
#1 0x00007fffd7a0d296 in QtPrivate::RefCount::ref() ()
from /home/hermann/rosws/devel_isolated/qt_gui_cpp/lib/python2.7/dist-packages/qt_gui_cpp/libqt_gui_cpp_shiboken.so
#2 0x00007fffd7a0d413 in QString::QString(QString const&) ()
from /home/hermann/rosws/devel_isolated/qt_gui_cpp/lib/python2.7/dist-packages/qt_gui_cpp/libqt_gui_cpp_shiboken.so
#3 0x00007fffd7792a29 in qt_gui_cpp::RosPluginlibPluginProvider<qt_gui_cpp::Plugin>::RosPluginlibPluginProvider(QString const&, QString const&) () from /home/hermann/rosws/devel_isolated/qt_gui_cpp/lib/libqt_gui_cpp.so
#4 0x00007fffd7a3794b in RosPluginlibPluginProvider_ForPluginsWrapper::RosPluginlibPluginProvider_ForPluginsWrapper(QString const&, QString const&) () from /home/hermann/rosws/devel_isolated/qt_gui_cpp/lib/python2.7/dist-packages/qt_gui_cpp/libqt_gui_cpp_shiboken.so
#5 0x00007fffd7a3a4e6 in Sbk_qt_gui_cpp_RosPluginlibPluginProvider_ForPlugins_Init ()
from /home/hermann/rosws/devel_isolated/qt_gui_cpp/lib/python2.7/dist-packages/qt_gui_cpp/libqt_gui_cpp_shiboken.so
#6 0x00000000004ab58b in ?? ()
#7 0x00000000004c1c83 in PyEval_EvalFrameEx ()
#8 0x00000000004ba506 in PyEval_EvalCodeEx ()
#9 0x00000000004d5d09 in ?? ()
#10 0x00000000004ee30e in ?? ()
#11 0x00000000004edec6 in ?? ()
#12 0x00000000004ab58b in ?? ()
#13 0x00000000004c1c83 in PyEval_EvalFrameEx ()
#14 0x00000000004c1934 in PyEval_EvalFrameEx ()
#15 0x00000000004c1934 in PyEval_EvalFrameEx ()
#16 0x00000000004c1934 in PyEval_EvalFrameEx ()
#17 0x00000000004c1934 in PyEval_EvalFrameEx ()
#18 0x00000000004c1934 in PyEval_EvalFrameEx ()
#19 0x00000000004ba506 in PyEval_EvalCodeEx ()
#20 0x00000000004c1e32 in PyEval_EvalFrameEx ()
#21 0x00000000004ba506 in PyEval_EvalCodeEx ()
#22 0x00000000004c1e32 in PyEval_EvalFrameEx ()
#23 0x00000000004ba506 in PyEval_EvalCodeEx ()
#24 0x00000000004ea9ef in ?? ()
#25 0x00000000004e56a2 in PyRun_FileExFlags ()
#26 0x00000000004e3f56 in PyRun_SimpleFileExFlags ()
#27 0x0000000000493abe in Py_Main ()
#28 0x00007ffff7810830 in __libc_start_main (main=0x493560 <main>, argc=4, argv=0x7fffffffd0a8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffd098) at ../csu/libc-start.c:291
#29 0x0000000000493489 in _start ()
Package versions:
python-qt-binding: 0.2.17-1
ros-kinetic-python-qt-binding: 0.3.4-0xenial-20191214-042219+0000
ros-kinetic-qt-gui{,-core,-cpp}: 0.3.11-0xenial-20191214-062939+0000
ros-kinetic-rqt{,-gui,-gui-cpp}: 0.5.0-0xenial-20191214-070708+0000
Thoughts:
Right now I'm trying to fix Shiboken2/PySide2 for versions > 2.0.0 targeting Arch Linux while not breaking Xenial/Kinetic and Melodic/Bionic. (See #79, ros-visualization/qt_gui_core#201)
Since Shiboken2/PySide2 seem to be broken on Xenial/Kinetic, wouldn't it be nicer to drop support for the semi-official release PySide 2.0.0-dev0 and move on to the official releases of PySide2 (>= 5.11), instead of keeping compatibility that may have never existed?
Status of Shiboken2/PySide2 in officially supported ROS versions:
Kinetic/Xenial: CI builds (http://build.ros.org/job/Kpr__qt_gui_core__ubuntu_xenial_amd64/11/)
Melodic/Bionic: CI skips (http://build.ros.org/job/Mpr__qt_gui_core__ubuntu_bionic_amd64/11/). I haven't tried offline build yet.
Melodic/Stretch: not available on Debian Stretch
rviz (the ros1 one), would not work because it only works on SIP; and SIP4, which is what this package seems to support for noetic and melodic (and apparently rolling and other recent distros as well), cannot work with recent libraries of pyqt5. There seem to be some drafted PRs for this. However, those are for the recent ROS2 distros. This issue aims to encourage backwards compatibility of these changes to noetic and possibly melodic as well.
Note: Close this issue if it is fixed upstream before necessary (for now) patches are introduced here.
Currently shiboken2
and PySide2
are not available on Zesty: see https://launchpad.net/~thopiekar/+archive/ubuntu/pyside-git/+packages
Therefore they have been removed from the rosdep key in ros/rosdistro#14180 to allow building the packages with PyQt support only.
CMake Error at /opt/ros/melodic/share/catkin/cmake/assert.cmake:17 (message):
Assertion failed: check for file existence, but filename
(RT_LIBRARY-NOTFOUND) unset. Message: RT Library
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/tools/rt.cmake:42 (assert_file_exists)
/opt/ros/melodic/share/catkin/cmake/all.cmake:163 (include)
/opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:4 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/pi/ros_catkin_ws/build_isolated/python_qt_binding/CMakeFiles/CMakeOutput.log".
See also "/home/pi/ros_catkin_ws/build_isolated/python_qt_binding/CMakeFiles/CMakeError.log".
<== Failed to process package 'python_qt_binding':
Command '['/opt/ros/melodic/env.sh', 'cmake', '/home/pi/ros_catkin_ws/src/python_qt_binding', '-DCATKIN_DEVEL_PREFIX=/home/pi/ros_catkin_ws/devel_isolated/python_qt_binding', '-DCMAKE_INSTALL_PREFIX=/opt/ros/melodic', '-DCMAKE_BUILD_TYPE=Release', '-G', 'Unix Makefiles']' returned non-zero exit status 1
Reproduce this error by running:
==> cd /home/pi/ros_catkin_ws/build_isolated/python_qt_binding && /opt/ros/melodic/env.sh cmake /home/pi/ros_catkin_ws/src/python_qt_binding -DCATKIN_DEVEL_PREFIX=/home/pi/ros_catkin_ws/devel_isolated/python_qt_binding -DCMAKE_INSTALL_PREFIX=/opt/ros/melodic -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles'
Command failed, exiting.
In systems that already switched to python3, e.g. Arch Linux, calling python
will execute python3. Normally, I just set the variable PYTHON_EXECUTABLE to /usr/bin/python2 to avoid this kind of problems. I suggest to use that variable instead of a hard-coded binary name in sip_helper.cmake as well.
The Hydro debs for Precise pull it in. However, ROS seems not ready for it (http://www.ros.org/reps/rep-0003.html#python) and on Precise there is a broken symlink (https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/941362).
I tried to install ros galactic from source but building fails at qt_binding.
This is the error:
--- stderr: python_qt_binding
Traceback (most recent call last):
File "setup.py", line 10, in <module>
d = generate_distutils_setup()
File "/home/agx/.local/lib/python3.6/site-packages/catkin_pkg/python_setup.py", line 75, in generate_distutils_setup
package = parse_package(package_xml_path)
File "/home/agx/.local/lib/python3.6/site-packages/catkin_pkg/package.py", line 583, in parse_package
xml, filename = _get_package_xml(path)
File "/home/agx/.local/lib/python3.6/site-packages/catkin_pkg/package.py", line 516, in _get_package_xml
raise IOError('Path "%s" is neither a directory containing a "%s" file nor a file' % (path, PACKAGE_MANIFEST_FILENAME))
OSError: Path "." is neither a directory containing a "package.xml" file nor a file
---
I dont know how to fix this
I just switched to Qt 5.12.4 on my test system and noticed that I need the current version from git to compile rviz due to #64 Could we have a new release soon for convenience?
thanks!
@dirk-thomas, yesterday's release of python_qt_binding (ros/rosdistro#22454) breaks all rviz binary builds on the build farm, e.g. http://build.ros.org/job/Mbin_ds_dS64__rviz__debian_stretch_amd64__binary/6/display/redirect
Any idea, why cmake cannot find python_qt_binding anymore?
$ rqt_bag
Traceback (most recent call last):
File "/home/jgoppert/git/catkin/devel/bin/rqt_bag", line 6, in <module>
exec(fh.read())
File "<string>", line 5, in <module>
File "/home/jgoppert/git/catkin/devel/lib/python2.7/dist-packages/rqt_bag/__init__.py", line 35, in <module>
exec(__fh.read())
File "<string>", line 35, in <module>
File "/home/jgoppert/git/catkin/src/rqt_common_plugins/rqt_bag/src/rqt_bag/plugins/topic_message_view.py", line 34, in <module>
from python_qt_binding.QtGui import QAction, QIcon, QToolBar
ImportError: cannot import name QAction
Compilation fails with the message
/usr/share/sip/PyQt5/QtCore/qregularexpression.sip:26:32: fatal error: qregularexpression.h: No such file or directory
compilation terminated.
src/python_qt_binding/cmake/sip_configure.py
is hardcoded to use the qmake
binary without doing any version checking. On Fedora, it's actually called qmake-qt5
and qmake
doesn't exist.
Another user using Slackware ran into the same issue.
Maybe the script should look for qmake-qt5
first, then try qmake
(with version checking).
This was already touched in #22 but not really solved.
Whatever you think will be in PATH for qmake, it is not standardised at all prior to Qt6. In Qt6, upstream finally decided to make Qt installable side-by-side using 6
suffix on respective Qt binaries, and they also introduced a distinction on what would be "user-facing" (in PATH) or not (remain in some lib/libexec subdir not in PATH). In Gentoo we decided to do the same with Qt5, we had already done a great deal of work in past years to fix packages not to depend on a random filename pattern search in PATH.
Therefore:
qmake may be any of binary, hardlink, softlink controlled by qtchooser, which may be switched at will to any major Qt version by the user through config file
Qt4 may be qmake, qmake4, qmake-qt4, qt4-qmake, and those are just variants I know of
Qt5 same as above, random across distros.
The cleanest way to solve this is give configure the possibility to have the QTBINDIR injected, which can then be set by distro accordingly.
Ubuntu 14.04 LTS / 64 bit. ROS/Gazebo Jade installed per instructions at "http://wiki.ros.org/jade/Installation/Ubuntu"
I'm working through the tutorials, in order. Everything went well until the first use of "rqt_graph" in the turtle tutorial. This produced the error:
rosrun rqt_graph rqt_graph
Traceback (most recent call last):
File "/opt/ros/jade/lib/rqt_graph/rqt_graph", line 8, in <module>
sys.exit(main.main(sys.argv, standalone='rqt_graph.ros_graph.RosGraph'))
File "/opt/ros/jade/lib/python2.7/dist-packages/rqt_gui/main.py", line 59, in main
return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider, plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH'])))
File "/opt/ros/jade/lib/python2.7/dist-packages/qt_gui/main.py", line 336, in main
from python_qt_binding import QT_BINDING
File "/opt/ros/jade/lib/python2.7/dist-packages/python_qt_binding/__init__.py", line 55, in <module>
from .binding_helper import loadUi, QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION # @UnusedImport
File "/opt/ros/jade/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 265, in <module>
getattr(sys, 'SELECT_QT_BINDING_ORDER', None),
File "/opt/ros/jade/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 84, in _select_qt_binding
QT_BINDING_VERSION = binding_loader(required_modules, optional_modules)
File "/opt/ros/jade/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 139, in _load_pyqt
_named_import('PyQt4.%s' % module_name)
File "/opt/ros/jade/lib/python2.7/dist-packages/python_qt_binding/binding_helper.py", line 106, in _named_import
module = builtins.__import__(name)
AttributeError: 'module' object has no attribute '__import__'
For Python 2.7.6, that's a standard error. There is no
builtins.__import__
in Python 2.7.6. It's there in 2.7.9, and 3.x, but not 2.7.6. So, with the stock Python of Ubuntu 14.04 LTS, ROS won't work.
From the Python documentation:
"__import__ is an advanced function that is not needed in everyday Python programming, unlike importlib.import_module()."
It's an internal function which changes between Python releases. Using it in binding_helper created a bug. Importlib should be used instead.
See also "http://answers.ros.org/question/210762/rqt_graph-not-finding-qt4/"
python_qt_binding
does not support QtQml so far.
Since shiboken2
does not support python3.12 and upstream does not plan to support python3.12 in a no-maintenance state at this time, upstream's current development efforts are focused on shiboken6
. Is there a plan to provide an option to support Qt6?
While these types are accessible when using e.g. PyQt4 directly:
from PyQt4 import QtCore
QtCore.QStringList
the same does not work thorugh python_qt_binding.
The user can usually use native Python strings and list of strings. But it would be nice if the same way which works for the native bindings would also work with python_qt_binding.
I fixed this with the command:
mkdir -p ~/ros/install/python_qt_binding/lib/python2.7/dist-packages/
Is it possible to use the CMake package provided by python_qt_binding
in other non-ROS projects?
The X11Embed*
classes have been removed in Qt 5. Maybe the feature can be reimplemented using QWindow::fromWinId()
and QWidget::createWindowContainer()
.
This is related to the transition to Qt 5 in #30.
This may or may not be a duplicate of #18, but it's definitely happening to me with regular old catkin_make:
mkdir -p pyqt_ws/src && cd pyqt_ws/src
git clone https://github.com/ros-visualization/python_qt_binding.git
cd ..
source /opt/ros/indigo/setup.bash
catkin_make install
Result:
Install the project...
-- Install configuration: ""
-- Installing: /home/administrator/pyqt_ws/install/_setup_util.py
-- Installing: /home/administrator/pyqt_ws/install/env.sh
-- Installing: /home/administrator/pyqt_ws/install/setup.bash
-- Installing: /home/administrator/pyqt_ws/install/setup.sh
-- Installing: /home/administrator/pyqt_ws/install/setup.zsh
-- Installing: /home/administrator/pyqt_ws/install/.rosinstall
-- Installing: /home/administrator/pyqt_ws/install/lib/pkgconfig/python_qt_binding.pc
-- Installing: /home/administrator/pyqt_ws/install/share/python_qt_binding/cmake/python_qt_binding-extras.cmake
-- Installing: /home/administrator/pyqt_ws/install/share/python_qt_binding/cmake/python_qt_bindingConfig.cmake
-- Installing: /home/administrator/pyqt_ws/install/share/python_qt_binding/cmake/python_qt_bindingConfig-version.cmake
-- Installing: /home/administrator/pyqt_ws/install/share/python_qt_binding/package.xml
+ cd /home/administrator/pyqt_ws/src/python_qt_binding
+ /usr/bin/env PYTHONPATH=/home/administrator/pyqt_ws/install/lib/python2.7/dist-packages:/home/administrator/pyqt_ws/build/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages CATKIN_BINARY_DIR=/home/administrator/pyqt_ws/build /usr/bin/python /home/administrator/pyqt_ws/src/python_qt_binding/setup.py build --build-base /home/administrator/pyqt_ws/build/python_qt_binding install --install-layout=deb --prefix=/home/administrator/pyqt_ws/install --install-scripts=/home/administrator/pyqt_ws/install/bin
running build
running build_py
creating /home/administrator/pyqt_ws/build/python_qt_binding/lib.linux-x86_64-2.7
creating /home/administrator/pyqt_ws/build/python_qt_binding/lib.linux-x86_64-2.7/python_qt_binding
copying src/python_qt_binding/QtBindingHelper.py -> /home/administrator/pyqt_ws/build/python_qt_binding/lib.linux-x86_64-2.7/python_qt_binding
copying src/python_qt_binding/__init__.py -> /home/administrator/pyqt_ws/build/python_qt_binding/lib.linux-x86_64-2.7/python_qt_binding
copying src/python_qt_binding/binding_helper.py -> /home/administrator/pyqt_ws/build/python_qt_binding/lib.linux-x86_64-2.7/python_qt_binding
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 2] No such file or directory: '/home/administrator/pyqt_ws/install/lib/python2.7/dist-packages/test-easy-install-23151.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/home/administrator/pyqt_ws/install/lib/python2.7/dist-packages/
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
CMake Error at python_qt_binding/catkin_generated/safe_execute_install.cmake:4 (message):
execute_process(/home/administrator/pyqt_ws/build/python_qt_binding/catkin_generated/python_distutils_install.sh)
returned error code
Call Stack (most recent call first):
python_qt_binding/cmake_install.cmake:55 (INCLUDE)
cmake_install.cmake:120 (INCLUDE)
make: *** [install] Error 1
Invoking "make install -j2 -l2" failed
Looks like the buildfarm job passes due to a sneaky little mkdir that happens in there, but seems not to happen for a regular old user like me trying to build this at home:
09:09:40 Install the project...
09:09:40 /usr/bin/cmake -P cmake_install.cmake
09:09:40 -- Install configuration: "None"
09:09:40 -- Installing: /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/debian/ros-jade-python-qt-binding/opt/ros/jade/lib/pkgconfig/python_qt_binding.pc
09:09:40 -- Installing: /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/debian/ros-jade-python-qt-binding/opt/ros/jade/share/python_qt_binding/cmake/python_qt_binding-extras.cmake
09:09:40 -- Installing: /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/debian/ros-jade-python-qt-binding/opt/ros/jade/share/python_qt_binding/cmake/python_qt_bindingConfig.cmake
09:09:40 -- Installing: /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/debian/ros-jade-python-qt-binding/opt/ros/jade/share/python_qt_binding/cmake/python_qt_bindingConfig-version.cmake
09:09:40 -- Installing: /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/debian/ros-jade-python-qt-binding/opt/ros/jade/share/python_qt_binding/package.xml
09:09:40 + cd /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19
09:09:40 + mkdir -p /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/debian/ros-jade-python-qt-binding/opt/ros/jade/lib/python2.7/dist-packages
09:09:40 + /usr/bin/env PYTHONPATH=/opt/ros/jade/lib/python2.7/dist-packages:/tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/obj-x86_64-linux-gnu/lib/python2.7/dist-packages:/opt/ros/jade/lib/python2.7/dist-packages:/tmp/ros_buildfarm: CATKIN_BINARY_DIR=/tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/obj-x86_64-linux-gnu /usr/bin/python /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/setup.py build --build-base /tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/obj-x86_64-linux-gnu install --root=/tmp/binarydeb/ros-jade-python-qt-binding-0.2.19/debian/ros-jade-python-qt-binding --install-layout=deb --prefix=/opt/ros/jade --install-scripts=/opt/ros/jade/bin
python_qt_binding/src/python_qt_binding/binding_helper.py
Lines 85 to 87 in 0c42506
Hi,
I have Ubuntu 16.04 64 bits and I am tryin to install ros-kinetic-python-qt-binding.
Unfortunately I get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ros-kinetic-python-qt-binding : Depends: libpyside2-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Note that libpyside2-dev is installed
➜ sudo apt-get install -f libpyside2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpyside2-dev is already the newest version (2.0.0+dev-0~201604151742~rev1858~pkg38~ubuntu16.04.1).
This is blocking me from releasing rviz
into Jade.
@dirk-thomas I haven't tried it yet, but you may need to consider merging #15 for Utopic+.
This is a dependency of rviz, @dirk-thomas do you think that any changes will be necessary here for the Qt5 migration? Currently the only issue is that it has a dependency on python-qt-bindings
and qt4-qmake
which would need to change on a Kinetic branch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.