need help with generating python bindings

Suman Chatterjee sum_chat at hotmail.com
Tue Apr 27 02:34:56 BST 2021


Hi Phil,
I have a question. I see all the sip files from PyQt are generated with the help of a  software called MetaSIP. Is there a way that we can access this software. We actually develop on top of Qt and we have lot of libraries and all the classes derived from QObject. Wondering if there is a simpler way to create the python bindings rather than having to create one .sip file corresponding to each header file.
Let me know what will be the best way to do it.
Thank You,
Suman

________________________________
From: Suman Chatterjee <sum_chat at hotmail.com>
Sent: Sunday, April 25, 2021 5:50 AM
To: Phil Thompson <phil at riverbankcomputing.com>
Cc: pyqt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
Subject: Re: need help with generating python bindings

It worked!!  I was missing a ReadMe file. When I created a ReadMe file it worked.

Thank You so much Phill for your help!! I will try now with some other C++ libraries.

Suman

________________________________
From: Suman Chatterjee <sum_chat at hotmail.com>
Sent: Sunday, April 25, 2021 4:40 AM
To: Phil Thompson <phil at riverbankcomputing.com>
Cc: pyqt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
Subject: Re: need help with generating python bindings

Thank You so much Phil!! I appreciate your fast response.

But I tried that already. It returns me the below error. It is able to make the build but fails during install.
Is there anything I am missing.


sumxxx:bin sumxxx$ source activate pythonBindingsEnv


(pythonBindingsEnv) sumxxx:pythonBindingsEnv sumxxx$ cd sip

(pythonBindingsEnv) sumxxx:sip sumxxx$ sip-install

Querying qmake about your Qt installation...

These bindings will be built: QtChart.

Generating the QtChart bindings...

Generating the .pro file for the QtChart module...

Generating the top-level .pro file...

Generating the Makefiles...

Compiling the project...

Installing the project...

sip-install: 'make install' failed returning 2


Thank You,
Suman
________________________________
From: Phil Thompson <phil at riverbankcomputing.com>
Sent: Saturday, April 24, 2021 8:04 AM
To: Suman Chatterjee <sum_chat at hotmail.com>
Subject: Re: need help with generating python bindings

On 24/04/2021 04:45, Suman Chatterjee wrote:
> Thank You so much Phil!! I tried that example. Yes that error is gone
> and it is able to build the project using PyQt-builder
> But the install failed with the below error.
>
>
> sxxx:sip sumxxx$ sip-install --tracing
>
> Querying qmake about your Qt installation...
>
> These bindings will be built: QtChart.
>
> Generating the QtChart bindings...
>
> Generating the .pro file for the QtChart module...
>
> Generating the top-level .pro file...
>
> Generating the Makefiles...
>
> Compiling the project...
>
> Installing the project...
>
> sip-install: 'make install' failed returning 2
>
>
> if I just use sip-build it builts the project
>
> sxxx:sip sumxxx$ sip-build
>
> Querying qmake about your Qt installation...
>
> These bindings will be built: QtChart.
>
> Generating the QtChart bindings...
>
> Generating the .pro file for the QtChart module...
>
> Generating the top-level .pro file...
>
> Generating the Makefiles...
>
> Compiling the project...
>
> The project has been built.
>
>
> But how do I install in a virtual Environment. If I specify target-Dir
> like this it throws the below error
>
>
> (pythonBindingsEnv) sumanc2:sip sum10122$ sip-install --target-dir
> pythonBindingsEnv
>
> Querying qmake about your Qt installation...
>
> These bindings will be built: QtChart.
>
> Generating the QtChart bindings...
>
> sip-install: Unable to find file "QtGui/QtGuimod.sip"
>
>
> So my question what is the way to install the generated python library
> in a virtual environment

Activate the environment, then install sip, PyQt-builder etc in the
environment. There is no need to specify any additional flags.

Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210427/4ab9e52c/attachment-0001.htm>


More information about the PyQt mailing list