Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. PythonQt cannot Build
Forum Updated to NodeBB v4.3 + New Features

PythonQt cannot Build

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 763 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    plloppii
    wrote on last edited by
    #1

    Hi All,

    I am new to the forums and I was wondering if someone could help me out with the issues I am having.
    I am trying to use the package, PythonQt here: https://mevislab.github.io/pythonqt/index.html
    to embedded a python script into a C++ Qt front end.
    I am having trouble building any of the examples sketches. I am running ubuntu 16.04 on vmware and I have QT 5 install and I am trying to use python2.7

    I have tried two ways to compile:
    cmd line, I run qmake && make
    I run into an error that says:

    g++ -c -m64 -pipe -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7 -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../src -I../../extensions/PythonQt_QtAll -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -o main.o main.cpp
    In file included from ../../src/PythonQt.h:46:0,
                     from main.cpp:42:
    ../../src/PythonQtUtils.h:48:22: fatal error: QByteArray: No such file or directory
    compilation terminated.
    Makefile:333: recipe for target 'main.o' failed
    make: *** [main.o] Error 1
    
    

    I also tried building through QtCreator, however the program lists these issues:

    g++ -Wl,-rpath,/home/plloppii/Qt/5.13.0/gcc_64/lib -o ../../lib/PyLauncher_d main.o   -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -lpython2.7 -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L../../lib/../lib -lPythonQt-Qt5-Python2.7_d -lPythonQt_QtAll-Qt5-Python2.7_d /home/plloppii/Qt/5.13.0/gcc_64/lib/libQt5Widgets.so /home/plloppii/Qt/5.13.0/gcc_64/lib/libQt5Gui.so /home/plloppii/Qt/5.13.0/gcc_64/lib/libQt5Core.so -lGL -lpthread   
    /usr/bin/ld: cannot find -lPythonQt-Qt5-Python2.7_d
    /usr/bin/ld: cannot find -lPythonQt_QtAll-Qt5-Python2.7_d
    /usr/bin/ld: cannot find -lGL
    Makefile:266: recipe for target '../../lib/PyLauncher_d' failed
    collect2: error: ld returned 1 exit status
    make: *** [../../lib/PyLauncher_d] Error 1
    07:34:32: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project PyLauncher (kit: Desktop Qt 5.13.0 GCC 64bit)
    When executing step "Make"
    07:34:32: Elapsed time: 00:00.
    

    If anyone could point me in the right direction, it would be greatly appriciated!!

    Regards,
    Noah

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by Kent-Dorfman
      #2

      I use pyqt5 quite frequently for pure python apps with qt guis, but there is something about embedding python code in a qt c++ app that bothers my sensibilities. I think the more professional approach would be to port the python script to c++ or to run it as a separate child process under the control of a qt app. Anyway, just my opionion, but good luck.

      To your specific question though, you are probably missing dev packages required for building the pythonqt package. not sure what those dev packages are but that's my guess. read the pythonqt build/install docs carefully.

      P 1 Reply Last reply
      0
      • Kent-DorfmanK Kent-Dorfman

        I use pyqt5 quite frequently for pure python apps with qt guis, but there is something about embedding python code in a qt c++ app that bothers my sensibilities. I think the more professional approach would be to port the python script to c++ or to run it as a separate child process under the control of a qt app. Anyway, just my opionion, but good luck.

        To your specific question though, you are probably missing dev packages required for building the pythonqt package. not sure what those dev packages are but that's my guess. read the pythonqt build/install docs carefully.

        P Offline
        P Offline
        plloppii
        wrote on last edited by
        #3

        @Kent-Dorfman
        I think that I could port the python script to c++ or I could just write my GUI in python as well with PyQt or Pyside.

        However my OCD is killing me because this error is just puzzling me.
        In one of the .prf files, there are these lines that don't make sense to me:

        unix::LIBS += -L$$DESTDIR/../lib -lPythonQt_QtAll-Qt5-Python$${PYTHON_VERSION}$${DEBUG_EXT}
        

        What is this looking for? The PythonQt library or the location of the python library itself?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You are at least missing the OpenGL development package.

          As for the others, they are likely generated during the build.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          P 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            You are at least missing the OpenGL development package.

            As for the others, they are likely generated during the build.

            P Offline
            P Offline
            plloppii
            wrote on last edited by
            #5

            @SGaist

            So I tried running a different example script, and I am getting this:

            /home/plloppii/Qt/5.13.0/gcc_64/bin/qmake -o Makefile ../PyLauncher/PyLauncher.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug
            g++ -Wl,-rpath,/home/plloppii/Qt/5.13.0/gcc_64/lib -o ../../lib/PyLauncher_d main.o   -L/usr/lib/python2.7/config-x86_64-linux-gnu -L/usr/lib -lpython2.7 -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L../../lib/../lib -lPythonQt-Qt5-Python2.7_d -lPythonQt_QtAll-Qt5-Python2.7_d /home/plloppii/Qt/5.13.0/gcc_64/lib/libQt5Widgets.so /home/plloppii/Qt/5.13.0/gcc_64/lib/libQt5Gui.so /home/plloppii/Qt/5.13.0/gcc_64/lib/libQt5Core.so -lGL -lpthread   
            /usr/bin/ld: cannot find -lPythonQt-Qt5-Python2.7_d
            /usr/bin/ld: cannot find -lPythonQt_QtAll-Qt5-Python2.7_d
            collect2: error: ld returned 1 exit status
            Makefile:267: recipe for target '../../lib/PyLauncher_d' failed
            make: *** [../../lib/PyLauncher_d] Error 1
            14:36:53: The process "/usr/bin/make" exited with code 2.
            Error while building/deploying project PyLauncher (kit: Desktop Qt 5.13.0 GCC 64bit)
            When executing step "Make"
            14:36:53: Elapsed time: 00:01.
            

            I cant seem to get through this error... It isnt asking me for the GL library anymore, but PythonQt-Qtall files.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved