Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

The sip directory for PyQt5 could not be located with Python3 #9

Open
fxkrait opened this issue Dec 23, 2019 · 8 comments
Open

The sip directory for PyQt5 could not be located with Python3 #9

fxkrait opened this issue Dec 23, 2019 · 8 comments
Labels

Comments

@fxkrait
Copy link

fxkrait commented Dec 23, 2019

[ 97%] Automatic MOC for target two_render_widgets
[ 97%] Built target two_render_widgets_autogen
[ 98%] Built target two_render_widgets
[ 98%] Running SIP generator for rviz_sip Python bindings...
sip: Unable to find file "QtCore/QtCoremod.sip"
Traceback (most recent call last):
File "/opt/ros/melodic/share/python_qt_binding/cmake/sip_configure.py", line 109, in
subprocess.check_call(cmd)
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/sip', '-c', '/tmp/trizen-toreshi/ros-melodic-rviz/src/build/sip/rviz_sip', '-b', '/tmp/trizen-toreshi/ros-melodic-rviz/src/build/sip/rviz_sip/pyqtscripting.sbf', '-I', '/usr/share/sip/PyQt5', '-w', '-n', 'PyQt5.sip', '-t', 'Qt_5_14_0', '-t', 'WS_X11', 'rviz.sip']' returned non-zero exit status 1.
make[2]: *** [src/python_bindings/sip/CMakeFiles/librviz_sip.dir/build.make:95: sip/rviz_sip/Makefile] Error 1
make[1]: *** [CMakeFiles/Makefile2:4244: src/python_bindings/sip/CMakeFiles/librviz_sip.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
:: Unable to build ros-melodic-rviz - makepkg exited with code: 4

Installed python2-sip-pyqt5 python2-pyqt5, and it compiled fine. Fix is probably to update the dependencies for the package.

@jwhendy
Copy link
Contributor

jwhendy commented Dec 23, 2019

I can't look deeper at the moment as I'm on vacation but this should be pulling python3 so I'm not sure why it's looking for a py2 version of that library.

Your error also references python3.8 so I'm doubly confused by the solution. @acxz any insights? You've been working through a lot of py related issues lately.

@cubimon
Copy link

cubimon commented Dec 23, 2019

This was my error:

[ 98%] Running SIP generator for rviz_sip Python bindings...
Traceback (most recent call last):
  File "/opt/ros/melodic/share/python_qt_binding/cmake/sip_configure.py", line 50, in get_sip_dir_flags
    sip_dir = config.pyqt_sip_dir
  File "/usr/lib/python3.8/site-packages/sipconfig.py", line 192, in __getattr__
    raise AttributeError("\"%s\" is not a valid configuration value or user option" % name)
AttributeError: "pyqt_sip_dir" is not a valid configuration value or user option

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/ros/melodic/share/python_qt_binding/cmake/sip_configure.py", line 85, in <module>
    sip_dir, sip_flags = get_sip_dir_flags(config)
  File "/opt/ros/melodic/share/python_qt_binding/cmake/sip_configure.py", line 65, in get_sip_dir_flags
    raise FileNotFoundError('The sip directory for PyQt5 could not be located. Please 
ensure' +
FileNotFoundError: The sip directory for PyQt5 could not be located. Please ensure that PyQt5 is installed
make[2]: *** [src/python_bindings/sip/CMakeFiles/librviz_sip.dir/build.make:95: sip/rviz_sip/Makefile] Error 1
make[1]: *** [CMakeFiles/Makefile2:4244: src/python_bindings/sip/CMakeFiles/librviz_sip.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Error making: ros-melodic-rviz

After installing python2-sip-pyqt5 and python2-pyqt5 it compiled fine and I couldn't find anything in the logs that mentioned python2, so I guess the installation used python3, so the sip folder is somehow missing in the python-sip-pyqt5 package? what is the sip folder anyway?

@acxz
Copy link
Member

acxz commented Dec 24, 2019

Looking into this, it seems like there is no python-sip-pyqt5 package on Arch. I tried making one and installing ros-melodic-rviz but I still ran into the same error as @cubimon. I can't reproduce @greghab 's error tho.
For now I can just add the python2-sip-pyqt5 and python2-pyqt5 packages to fix the build, but I really do not want to have a python2 dep in ros-melodic-desktop-full.
Let me try a couple more things. The errors are being raised in ros-melodic-python-qt-binding maybe that package is the one that needs to patched/fixed.

Hmmm, yeah not sure what the underlying issue, I'lI just add the deps for now and reflag this as a python issue.

@fxkrait
Copy link
Author

fxkrait commented Dec 24, 2019

Here's two more build error outputs for some more data: https://pastebin.com/xfmFPeMC
(Should also mention that for the outputs added, I also installed all packages that occur prior to ros-melodic-rqt-image-view)
I'm getting some different (but similar) errors. It might be because I hard removed the package (and installed some new ros packages), IDK.

@acxz
Copy link
Member

acxz commented Dec 24, 2019

@greghab or @cubimon if you guys have made any upstream issues relating to this issue at either the rviz or python-qt-binding repo please reference them here (or vice versa). Frankly I believe this is something upstream needs to take a look at. I would also try to contact the maintainer for the Arch python2-sip-pyqt5 package and see if he can create one for python-sip-pyqt5.

EDIT: Unfortunately, I actually won't be able to spend more time on this.

@cubimon
Copy link

cubimon commented Dec 24, 2019

i just installed the python2-sip-pyqt5 and python2-pyqt5 packages and went on 😅. But it sure would be nice if it is fixed.

@stertingen
Copy link

@greghab or @cubimon if you guys have made any upstream issues relating to this issue at either the rviz or python-qt-binding repo please reference them here (or vice versa). Frankly I believe this is something upstream needs to take a look at. I would also try to contact the maintainer for the Arch python2-sip-pyqt5 package and see if he can create one for python-sip-pyqt5.

EDIT: Unfortunately, I actually won't be able to spend more time on this.

There used to be a package python-sip-pyqt5:
https://git.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/sip&id=c54e6b92bda43fbea070c1b00c0695ec495c29c4

@jwhendy
Copy link
Contributor

jwhendy commented Jan 3, 2020

Edit: submitted upstream inquiry.


The error comes from this function trying to figure out where the right sip directory is:

    try:
        sip_dir = config.pyqt_sip_dir
        sip_flags = config.pyqt_sip_flags
        return sip_dir, sip_flags

config.pyqt_sip_dir should exist, but I'm not sure which part of this Class is supposed to do it. In any case, it's not there when the try block above tries to get it.

I noticed that after we run into an Exception, there are a few more tries to set the directory to something that might exist. That suggests that it's looking for the directory at /usr/share/sip/PyQt5.

According to the file list for python2-pyqt5, it uses that directory which is why it succeeds as a workaround. In python-pyqt5, it's not there and analogous sip-related files are now installed to /usr/lib/python3.8/site-packages/PyQt5/bindings.

I manually edited /opt/ros/melodic/share/python_qt_binding/cmake/sip_configure.py to add this block:

        # arch python3 pkg uses /usr/lib/python3.8/site-packages/PyQt5/bindings directory
        default_sip_dir = os.path.join(sipconfig._pkg_config['default_mod_dir'], 'PyQt5', 'bindings')
        if os.path.exists(default_sip_dir):
            return default_sip_dir, sip_flags

On my first build, I did run into this error, but a rebuild right after succeeded.

during GIMPLE pass: einline
In file included from /usr/include/boost/bind.hpp:22,
                 from /opt/ros/melodic/include/ros/publisher.h:35,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /opt/ros/melodic/include/tf/message_filter.h:35,
                 from /home/jwhendy/installed/build/ros-melodic-aur/ros-melodic-rviz/src/rviz-1.13.5/src/rviz/default_plugin/marker_display.h:40,
                 from /home/jwhendy/installed/build/ros-melodic-aur/ros-melodic-rviz/src/rviz-1.13.5/src/rviz/default_plugin/markers/points_marker.cpp:31:
/usr/include/boost/bind/bind.hpp: In member function ‘R boost::_bi::list1<A1>::operator()(boost::_bi::type<R>, F&, A&, long int) [with R = bool; F = boost::_mfi::mf0<bool, boost::detail::shared_state_base>; A = boost::_bi::list0; A1 = boost::reference_wrapper<boost::detail::shared_state_base>]’:
/usr/include/boost/bind/bind.hpp:249:42: internal compiler error: Segmentation fault
  249 |         return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants