c++qtpythonqt

How to build PythonQt in ubutnu


I want to embed the python script in my c++ Qt application, By searching on the net I found that PythonQt is exactly what I am looking for but when I went to it's github repo there is build description given for windows system but not for ubuntu system so after cloning the repo if I include it's src in my Qt .pro file it gives me output that Python.h not found, I think the reason is that I didn't build it in my system. Is there anyone who could tell me that how to build PythonQt in ubuntu. The link for their repo is this: https://github.com/MeVisLab/pythonqt

If this didn't work you can also suggest me some other thing which will help me to embed python scripts into my Qt c++ application.


Solution

  • First clone the repo by using the following command https://github.com/MeVisLab/pythonqt.git After that cd into the clone folder and execute the below command to build it into your system.

    qmake
    

    This command will generate the MakeFile into your current directory run the following command to completely build the PythonQt in your system.

    sudo make all
    sudo make install
    

    While executing those commands if you get the following error

    fatal error: 'private/qmetaobjectbuilder_p.h'
    

    Run the below command to solve this

    sudo apt install qtbase5-private-dev