Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Add Shiboken2 to QtCreator
Please_Help_me_D last edited by
I started to learn how to bind Pyside2 and Qt (C++).
I have installed PySide2 using pip install
pip install PySide2==5.14.2
5.14.2 is the version that I work with in Qt C++ (in QtCreator).
Now I have:
- C:\Qt where I have: MaintenanceTool.exe, folder where 5.14.2, Tools folder etc.
As you can see I use python env
MyEnv38and I do not set PATH var to there.
Now I want:
- check wether PySide2 installed with pip install is built with MSVC 2017 x64 (this architecture I'm working with and all my libraries are built with it)
- somehow add
shiboken2to my Qt Creator kits (or something) so I could launch examples from
pyside-setup\examplesand write codes. Now when I try to open
Project MESSAGE: Using python interpreter: python
Python was not found but can be installed from the Microsoft Store: https://go.microsoft.com/fwlink?linkID=2082640
Project ERROR: Unable to locate the shiboken2-generator package location
Here is how I set Python in QtCreator:
Please_Help_me_D last edited by Please_Help_me_D
I solved this issue: the problem was that directories to my python:
were somewhere at the end of the PATH var. So Windows apps (probably AppData\Local\Microsoft\WindowsApps) used to throw its warnings and errors before the compiler gets Python var.
Thus I moved Python vars to the very top.
Then I can run QMake of
pyside-setup\examples\scriptableapplication.prowich is in the F:\Qt\Downloaded\pyside-setup\examples\scriptableapplication
But when I run it I get the error:
Here I found some solution but it doesn't work.
C:\apps\MSVC_apps_release\CTK\binCTK widgets and if I delete this variable then the problem is not solved.
Then if I set new variable
C:\Anaconda3\envs\MyEnv38\Lib\site-packages\PySide2\plugins\platformsthen after running the application I get the output:
I don't know what the output should be without errors but here I can see
Fatal Python errorwich means that something is not going well...
Please help me understand how to work with Python in Qt
By the way there is no problem to use PySide2 in PyCharm but I need to somehow learn how to perform Python C++ bindings