need help with generating python bindings
Suman Chatterjee
sum_chat at hotmail.com
Sat Apr 24 04:45:28 BST 2021
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
Kindly let me know what to do.... I will really appreciate it.
Thank You,
Suman
________________________________
From: Phil Thompson <phil at riverbankcomputing.com>
Sent: Friday, April 23, 2021 6:55 AM
To: Suman Chatterjee <sum_chat at hotmail.com>
Cc: pyqt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
Subject: Re: need help with generating python bindings
On 23/04/2021 01:10, Suman Chatterjee wrote:
> Hi,
> I am following the hello demo to create python bindings using sip. I
> have installed PyQt5-5.15.4, sip-6.0.3 as below
>
>
> Requirement already satisfied: toml in
> /usr/local/lib/python3.9/site-packages (from sip) (0.10.2)
>
> Requirement already satisfied: pyparsing>=2.0.2 in
> /usr/local/lib/python3.9/site-packages (from packaging->sip) (2.4.7)
>
> Installing collected packages: sip, PyQt5
>
> Successfully installed PyQt5-5.15.4 sip-6.0.3
>
> I also wrote the hello.sip file as below
>
> %Module(name=hello, language="C")
> %Import QtCore/QtCoremod.sip
> class Hello : QLabel {
> %TypeHeaderCode
> #include <hello.h>
> %End
> ......
>
> Then when I run sip-install it throws me the below error .
>
>
> VVVV:sip XXXXXX$ sip-install
>
> These bindings will be built: hello.
>
> Generating the hello bindings...
>
> sip-install: Unable to find file "QtCore/QtCoremod.sip"
>
>
> But I verified the file exists in the path
> usr ▸ local ▸ lib ▸ python3.9 ▸ site-packages ▸ PyQt5 ▸
> bindings ▸ QtCore
>
>
> So how do I point to that bindings folder. I tried exporting that Path
> in my bash_profile. But it did not help.
>
> I will really appreciate if anyone can please help me out
If you are building bindings on top of PyQt then you need to use
PyQt-builder. This implements extensions to SIP.
https://www.riverbankcomputing.com/static/Docs/PyQt-builder/
Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210424/ec597377/attachment-0001.htm>
More information about the PyQt
mailing list