need help with the .toml file. /lib/python3.9/site-packages/PyQt5/bindings/QtQuick/qquickitem.sip:26:10: fatal error: 'qquickitem.h' file not found

Suman Chatterjee sum_chat at hotmail.com
Sun May 2 21:11:20 BST 2021


Thank You Phil for getting back.

Yea I am  importing  only the ones I need like as below. If I do not import then it will throw error like


sip-install: ::QQuickFramebufferObject has not been defined.


%Module(name=Runtime.Qt, keyword_arguments="Optional", use_limited_api=True)

ABCmod.sip

%Include Core_QList_qint64.sip

%Include Core_CoreTypes.sip
.......
%Include Mapping_ArcGISVectorTiledLayer.sip
%Include Mapping_ArcGISSceneLayer.sip
%Include Mapping_ImageAdjustmentLayer.sip
%Include Mapping_UnknownLayer.sip
 ........



%Import QtQuick/QtQuickmod.sip
%Import QtPositioning/QtPositioningmod.sip
%Import QtSensors/QtSensorsmod.sip
%Import QtWidgets/QtWidgetsmod.sip



If I look in the file sipQtcmodule.cpp that gets generated I can see

/* This defines the types that this module needs to import from QtQuick. */
sipImportedTypeDef sipImportedTypes_Qt_QtQuick[] = {
    {"QQuickFramebufferObject"},
    {"QQuickFramebufferObject::Renderer"},
    {"QQuickItem"},
    {"QQuickItem::ItemChange"},
    {"QQuickItem::ItemChangeData"},
    {"QQuickItem::UpdatePaintNodeData"},
    {"QSGNode"},
    {"QSGTextureProvider"},
    {SIP_NULLPTR}
};



I also have the exact same .toml file like the example for the QtCharts one.

# Specify the build system requirements.
[build-system]
requires = ["sip >=5.3, <7", "PyQt-builder >=1.6, <2"]
build-backend = "sipbuild.api"

# Specify the PEP 566 metadata for the project.
[tool.sip.metadata]
name = "ABCRuntime"
version = "100.10"
summary = "Python bindings for the xxx Runtime library"
home-page = "https://www.abc.com"
author = "xxx"

license = "GPL v3"
requires-dist = "PyQt5 (>=5.15)"
description-file = "README"



# Specify a PyQt-based project.
[tool.sip]
project-factory = "pyqtbuild:PyQtProject"
# Configure the project.
[tool.sip.project]
tag-prefix = "ABCRuntime"
# Configure the building of the fib bindings.

[tool.sip.bindings.ABCRuntime]

Still it throws


/Users/sumxxx/pythonBindingsEnv/lib/python3.9/site-packages/PyQt5/bindings/QtQuick/qquickitem.sip:26:10: fatal error: 'qquickitem.h' file not found


What do I look for now?  I really cannot figure out what's the issue... It works for QtCharts but not for any other library.

Thank You,
Suman

________________________________
From: Phil Thompson <phil at riverbankcomputing.com>
Sent: Saturday, May 1, 2021 12:24 PM
To: Suman Chatterjee <sum_chat at hotmail.com>
Cc: pyqt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
Subject: Re: need help with the .toml file. Not able to find the Qt headers

Are you %Importing the Qt module? If so, don't. Only %Import the
bindings your library actually depends on.

Phil

On 30/04/2021 19:51, Suman Chatterjee wrote:
> looks like it is not searching for the headers related to QtQuick. I
> can see from the logs that it is searching for only QtCore and QtGui
> headers but not for others. I have the import for the others also in
> the sip file. Is there any other configuration that I am missing...
>
>
> Reading /Users/sum10122/pythonBindingsEnv/sip/build/Qt/Qt.pro
>
> Compiling the project...
>
> make
>
> cd Qt/ && ( test -e Makefile || /usr/local/opt/qt/bin/qmake -o
> Makefile /Users/sum10122/pythonBindingsEnv/sip/build/Qt/Qt.pro ) &&
> /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
>
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
> -c -pipe -stdlib=libc++ -O2 -std=gnu++11  -arch x86_64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
> -mmacosx-version-min=10.13 -fno-exceptions -Wall -Wextra -fPIC
> -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_EXCEPTIONS
> -DQT_NO_DEBUG -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I..
> -I/usr/local/Cellar/python at 3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/include/python3.9
> -I/usr/local/Cellar/qt/5.15.2/lib/QtGui.framework/Headers
> -I/usr/local/Cellar/qt/5.15.2/lib/QtCore.framework/Headers -I.
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Headers
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AGL.framework/Headers
> -I/usr/local/Cellar/qt/5.15.2/mkspecs/macx-clang
> -F/usr/local/Cellar/qt/5.15.2/lib -o sipQtcmodule.o sipQtcmodule.cpp
>
> In file included from sipQtcmodule.cpp:7:
>
> /Users/sum10122/pythonBindingsEnv/lib/python3.9/site-packages/PyQt5/bindings/QtQuick/qquickitem.sip:26:10:
> fatal error: 'qquickitem.h' file not found
>
> #include <qquickitem.h>
>
>
> ________________________________
> From: Phil Thompson <phil at riverbankcomputing.com>
> Sent: Thursday, April 29, 2021 9:26 PM
> To: Suman Chatterjee <sum_chat at hotmail.com>
> Cc: pyqt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
> Subject: Re: need help with the .toml file. Not able to find the Qt
> headers
>
> On 29/04/2021 20:04, Suman Chatterjee wrote:
>> Hi,
>>  I am writing a .toml file to generate the  Python bindings for a C++
>> library like below
>>
>> # Specify the build system requirements.
>> [build-system]
>> requires = ["sip >=5.3, <7", "PyQt-builder >=1.6, <2"]
>> build-backend = "sipbuild.api"
>>
>> # Specify the PEP 566 metadata for the project.
>> [tool.sip.metadata]
>> name = "ABC"
>> version = "100.10"
>> summary = "Python bindings for the ArcGIS Runtime library"
>> home-page = "https://www.xxx.com"
>> author = "xxx"
>>
>> license = "GPL v3"
>> requires-dist = "PyQt5 (>=5.15)"
>> description-file = "README"
>>
>> # Configure the building of the fib bindings.
>> [tool.sip.bindings.ABC]
>>
>> include-dirs = ["~/ABC_SDKs/Qt100.10/sdk/include"]
>>
>> # Specify a PyQt-based project.
>> [tool.sip]
>> project-factory = "pyqtbuild:PyQtProject"
>> # Configure the project.
>> [tool.sip.project]
>> tag-prefix = "ABC"
>>
>>
>> Now when I run sip-install. I am getting the below error
>>
>>
>> /Users/xxx/pythonBindingsEnv/lib/python3.9/site-packages/PyQt5/bindings/QtQuick/qquickitem.sip:26:10:
>> fatal error: 'qquickitem.h' file not found
>>
>> #include <qquickitem.h>
>>
>>          ^~~~~~~~~~~~~~
>>
>>
>> So my question is Do I need to copy all the QT headers files in a
>> folder and add that in the Include-Dirs section of the .toml file. I
>> have the Qt installation added to my PATH like as below
>>
>>
>> export PATH=/usr/local/opt/qt/bin:$PATH
>>
>>
>> But somehow it is not able to find them. But the similiar .toml file
>> worked when I did for the QtCharts. Seems like if I include any other
>> folder then it does not search in other paths.
>
> include-dirs isn't used to find the Qt .h files. qmake is the bit that
> knows where they are. Run 'qmake -query' to see where it thinks they
> are. Also looking at the generated .pro and Makefiles may give you some
> clues.
>
> Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210502/9de0b9b6/attachment.htm>


More information about the PyQt mailing list