Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
107 views
in Technique[技术] by (71.8m points)

c++ - 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.

question from:https://stackoverflow.com/questions/65924650/how-to-build-pythonqt-in-ubutnu

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...