[PyQt] Deploying PyQt in a C++ Application

Phil Thompson phil at riverbankcomputing.com
Thu Aug 6 23:40:26 BST 2015

On 06/08/2015 11:22 pm, Ferguson, Eric W (397B) wrote:
> Phil,
> Thanks for answering my questions so quickly. Again, pardon my 
> ignorance
> since I am new to python deployment.
> Since you said using pydeployqt was possible, I had a few additional
> questions regarding that tool:
> 1.The first tab of the pydeployqt GUI is for your application source.
> Since I am embedding python into my C++ application, I don¹t really 
> think
> I have an application source. It seems like something has to be 
> specified
> on this tab though and I am not sure what to include.

Your Python code that you want to embed in your application. You might 
have a problem if there isn't any - that particular corner case won't 
have been tested - but that can be fixed.

> 2. I definitely know which PyQt modules and standard library modules I
> want to include, so those tabs were easy. However, the location tab is 
> a
> bit confusing for me as well. I want to use python2.7 as the 
> interpreter.
> The next tab requests the source location for python. Python 2.7 came
> preinstalled on my mac - does that include the python source code or do 
> I
> need to get a tarballed source from python.org?

You need to get the source.

> 3. For the target python locations, I know where to find the python
> include directory for 2.7 on my machine. In the tutorial for the python
> library, it looks like you are pointing to a static library (.a). Does
> this mean I need to statically build the python library before using 
> this
> tool, or will the tool do that for me? Do I give it the path to a 
> library
> that already exists or is this a path to the library that will be 
> built?

Whether you embed a static version of the library with your application, 
or distribute a copy of the dynamic version with your application is up 
to you.

The path is to a library that already exists.

> I also noticed your static build section after the pyqtdeploy tutorial
> using the command line interface tool. Perhaps I shouldn¹t be using the
> pydeployqt GUI and instead should be using that tool instead? If so, 
> how
> can I include more than a small sub-set of the standard libraries in my
> static build of python?

You can't. pyqtdeploycli is intended to be used by build systems - it 
never modifies a .pdy project file.


More information about the PyQt mailing list