[PyQt] Re; Deploying PyQt in a C++ Application 

Rembrand (daxLAB Limitted) rembrand at daxlab.com
Thu Aug 6 11:39:30 BST 2015


I believe that all of your wishes can be fulfilled with PyInstaller. I work with it to deploy standalone autonomic apps on Windows and Linux. It even supports Pyqt4 and 5. If you use python v3 then you should download the development version of pyinstaller. 

You can install pyinstaller by running
    pip install pyinstaller
from the command line (pip is a python setup tool for python packages that are  online available).

If pip is not installed search for your OS platform on how to do that.

Pyinstaller will try to find all its (your python app) dependencies including C object modules and/executables like the Qt runtime libs as well the PyQt libs . You can also add modules manually  it cannot detect automatically due to hidden/hacked imports. 

My setup is completely  dynamically using imports of native python scripts, python executable C extension modules as well as straight forward standalone executables.

You can then chose to make a single self extracting executable image  or a single directory setup image where both images
contain all dependencies including the python interpreter and it's libs.

However you might be forced  to make use of a default python install since I do not know how it supports an embedded python setup. But you could let pyinstaller  embed (C stuff into python) instead of you taking care of embedding python  into C stuff.

So with pyinstaller it is the other way around.......
 


Best regards,
Rembrand

Cell phone: +31 646.224.526
Email: rembrand at daxlab.com
Sent from my smart phone.



-------- Original message --------
From: pyqt-request at riverbankcomputing.com 
Date: 06/08/2015  09:41  (GMT+01:00) 
To: pyqt at riverbankcomputing.com 
Subject: PyQt Digest, Vol 133, Issue 10 

Send PyQt mailing list submissions to
pyqt at riverbankcomputing.com

To subscribe or unsubscribe via the World Wide Web, visit
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
or, via email, send a message with subject or body 'help' to
pyqt-request at riverbankcomputing.com

You can reach the person managing the list at
pyqt-owner at riverbankcomputing.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PyQt digest..."


Today's Topics:

   1. Re: Which IDE is good for developing PyQt application
      (Johan Fläckman)
   2. [pyqtdeploy] Add ability to specify type of build (Ilya Kulakov)
   3. scribus: connecting a c++ signal with a pyqt5 slot (ale rimoldi)
   4. Deploying PyQt in a C++ Application (Ferguson, Eric W (397B))
   5. [pyqtdeploy] Android Service (Sébastien RAMAGE)


----------------------------------------------------------------------

Message: 1
Date: Wed, 5 Aug 2015 20:13:42 +0200
From: Johan Fläckman <flackman.johan at gmail.com>
To: oliver <oliver.schoenborn at gmail.com>
Cc: pyqt at riverbankcomputing.com
Subject: Re: [PyQt] Which IDE is good for developing PyQt application
Message-ID:
<CANpkKNfF_MkDQOuR=_7r-y08uKZPuvjRdaSLJyv2jUBphScfkA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

I'm using eclipse with pydev, worked out pretty well.
On Aug 5, 2015 6:45 PM, "oliver" <oliver.schoenborn at gmail.com> wrote:

> Yes thanks for the important correction, I had forgotten that. There were
> features in Pro that I really wanted (
> https://www.jetbrains.com/pycharm/features/editions_comparison_matrix.html)
> but the Community version is what I used for the first year and is very
> feature-full.
>
> On Wed, Aug 5, 2015 at 9:17 AM, Florian Bruhin <me at the-compiler.org>
> wrote:
>
>> * oliver <oliver.schoenborn at gmail.com> [2015-08-05 09:08:49 -0400]:
>> > However, the Community edition is only available free under
>> > certain conditions (open source project with active mailing list for 3
>> > months, etc). If you can afford the 100$ I would go for it, you'll
>> never go
>> > back.
>>
>> You're thinking of the (gratis) open-source license for the
>> professional edition.
>>
>> The community edition is free (as in free beer and as in freedom!) for
>> everyone, but has a limited featureset:
>>
>> https://www.jetbrains.com/pycharm/download/
>>
>> (if someone is interested in my own opinion about it: I tried it after
>> hearing many good things about it, and found it doesn't really fit my
>> workflow - tiling window manager, using terminals a lot, etc.)
>>
>> Florian
>>
>> --
>> http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
>>    GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
>>          I love long mails! | http://email.is-not-s.ms/
>>
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>
>
> --
> Oliver
> Author of these Open Source: PyPubSub <http://pubsub.sf.net>, Lua-iCxx
> <http://lua-icxx.sf.net>, iof <http://iof.sf.net>
> Regular contributor on StackOverflow
> <http://stackoverflow.com/users/869951/schollii>
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150805/0b606e33/attachment-0001.html>

------------------------------

Message: 2
Date: Wed, 5 Aug 2015 16:02:38 -0400
From: Ilya Kulakov <kulakov.ilya at gmail.com>
To: pyqt at riverbankcomputing.com
Cc: Артем Мартынович  <artem.martynovich at gmail.com>
Subject: [PyQt] [pyqtdeploy] Add ability to specify type of build
Message-ID: <6F86B11D-3477-4842-B871-D442BD231A1C at gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi Phil,

We need to be able to specify type of build (release or debug) for our buildsystem.
This is how we achieved this: https://github.com/GreatFruitOmsk/pyqtdeploy/commit/8242d631e9f505a657a88b9ec0d8e1e140ee927b.patch <https://github.com/GreatFruitOmsk/pyqtdeploy/commit/8242d631e9f505a657a88b9ec0d8e1e140ee927b.patch> but I believe you will want to make it configurable.


Best Regards,
Ilya Kulakov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150805/2e9dd90d/attachment-0001.html>

------------------------------

Message: 3
Date: Wed, 5 Aug 2015 22:39:39 +0200
From: ale rimoldi <ale.comp_06 at xox.ch>
To: PyQt Mailing List <pyqt at riverbankcomputing.com>
Subject: [PyQt] scribus: connecting a c++ signal with a pyqt5 slot
Message-ID: <20150805223939.4804888d at eiseiseis>
Content-Type: text/plain; charset=US-ASCII

hey

i come back with a question i've already asked a few months ago because
i still have not found an answer.

the issue is about porting the scribus scripter engine from pyqt4 to
pyqt5 and adapt it to the new way of handling signals and slots


http://scribus.net/websvn/filedetails.php?repname=Scribus&path=%2Ftrunk%2FScribus%2Fscribus%2Fplugins%2Fscripter%2Fpython%2Finit_scripter.py

has the following code

    def createMenu(mainWindow):
        Scripter.menu = ScripterMenu(mainWindow)

    Scripter.connect("createMenu(QMainWindow*)", createMenu)

the code used to work with pyqt4 and connects a createMenu signal
emitted by the c++ code and allows the ScripterMenu class to attach new
menu entries to the mainWindow object it gets from c++.

the interface between c++ and python is managed through libpython3.5
and pythonize.

my effort to port the scripter to python3 and pyqt5 is blocked in here

https://github.com/aoloe/scribus-plugin-scripter/blob/master/src/python/init_scripter.py#L94

the most common error i'm getting being

AttributeError: 'PyQt5.QtCore.pyqtSignal' object has no attribute
'connect'

... but the current code simply get's through without creating a
navigation entry....


does anybody have a hint what i can do?

have a nice evening
a.l.e


------------------------------

Message: 4
Date: Thu, 6 Aug 2015 04:03:12 +0000
From: "Ferguson, Eric W (397B)" <Eric.W.Ferguson at jpl.nasa.gov>
To: "pyqt at riverbankcomputing.com" <pyqt at riverbankcomputing.com>
Subject: [PyQt] Deploying PyQt in a C++ Application
Message-ID: <D1E8231C.1A5E2%Eric.W.Ferguson at jpl.nasa.gov>
Content-Type: text/plain; charset="windows-1252"

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!

Regards,
________________________________
Eric Ferguson
NASA/Jet Propulsion Laboratory
Mission Operations Engineer (397B)
818.634.1928

"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-0001.html>

------------------------------

Message: 5
Date: Thu, 06 Aug 2015 09:41:12 +0200
From: Sébastien RAMAGE <sramage at poifindus.com>
To: "pyqt at riverbankcomputing.com" <pyqt at riverbankcomputing.com>
Subject: [PyQt] [pyqtdeploy] Android Service
Message-ID: <55C30F98.1070308 at poifindus.com>
Content-Type: text/plain; charset=utf-8; format=flowed

It would be very fun to be able to create service application on android 
using python.

I found this :
https://github.com/think-free/QtAndroidHelper

Do you think this can be include in pyqtdeploy ?
It could be a choice when building the .pro,  Activity app or Service 
app or Both ?


Seb


------------------------------

Subject: Digest Footer

_______________________________________________
PyQt mailing list
PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

------------------------------

End of PyQt Digest, Vol 133, Issue 10
*************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150806/2fbe7cb6/attachment-0001.html>


More information about the PyQt mailing list