[PyQt] Deploying PyQt in a C++ Application

Ferguson, Eric W (397B) Eric.W.Ferguson at jpl.nasa.gov
Thu Aug 6 05:03:12 BST 2015

Currently, I am developing a C++ GUI application using the Qt framework with OpenGL. Typically this application is driven by user mouse/keyboard input. However, we have recently built a python interface using PyQt so users can  drive the application with simple python scripts. This means that we have an embedded python within our C++ application, and whenever a user loads in a python script, that script imports another script which makes PyQt calls to access certain Qt C++ methods in the application.

All of this functionality works in my development environment, but now I would like to deploy my application without requiring users to have PyQt since they will not need to use it directly within their scripts. Ultimately I would like to deploy the application on Mac, Windows and Linux environments. Since I am completely new to python deployment, I did some reading and it seems like I need to include the following in my deployment:

  1.  Python interpreter
  2.  Python standard libraries – Ideally, we want users to have access to all of the standard libraries modules in case they want to do complex python programming within their scripts.
  3.  PyQt

As a note, right now, I dynamically link in Qt libraries to my application and include those DLLs within the application bundle.

So now for my questions:

  1.  I read through the pyqtdeploy documentation and it looks like this tool has the capability to statically build all three of the dependencies listed above. However, that tool seems geared towards making complete application binaries. In my case, I would simply want these statically built, and then I would go about linking the dependencies to my application. Would it be feasible to use the pyqtdeploy tool to accomplish my objective?
  2.  I don’t completely understand the implications of statically building the python interpreter on Windows. It sounds like if I build python statically, I won’t be able to dynamically import C/C++ extension modules. Since I want to include most if not all of the python standard libraries, and the standard library includes C extension modules, then will I have to use a dynamic build of Python on windows?
  3.  Let’s say I did not want to build PyQt statically, but instead wanted to include it as a set of dynamic libraries. When I installed PyQt, it built .so files for each Qt module (QtGui, QtCore, etc.), however, those libraries have Qt dependencies that are dependent on the location of the Qt C++ libraries on my machine. How can I remove the dependencies in those .so files so that they point at a relative path, or is that even possible?

Thanks in advance for any help!

Eric Ferguson
NASA/Jet Propulsion Laboratory
Mission Operations Engineer (397B)

"It’s human nature to stretch, to go, to see, to understand. Exploration is not a choice, really; it’s an imperative." - Michael Collins
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150806/fd42a010/attachment.html>

More information about the PyQt mailing list