Trying to build with cmake, getting "No Module named PythonQt" error when...
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
So, I will say that I have PythonQt working beautifully with a qmake build. However, times are changing, and so must I. I've ported pretty much everything over into CMake. However, Python is the one thing that is not working quite right. As I said, I'm getting the
ModuleNotFoundError: No module named \PythonQt\
. So, something is not quite right. I would very much appreciate help in either 1) figuring out what is wrong with my cmake, or 2) figuring out where PythonQt actually defines itself on the Python side so I can debug the code at runtime.I'm honestly surprised to be running into a bug right this, since it seems like Python and everything linked correctly (I'm not getting any library errors), but I may have lost some dependency that would make PythonQt unhappy (but not raise a compile error? It's weird).
I've done a bit of digging, and noticed that PythonQt simply isn't initializing at all, which is upsetting. I'm reexamining my library paths and seeing if there's a way to figure this out.
Edit: I was wrong,
PythonQt::self()
looks fine, at least from what I can tell. It exists at least.Edit 2: It looks like I'm not getting any errors on
PythonQt::init()
, andPy_Initialize()
is getting called from PythonQt. However,Py_IsInitialized()
returns false after initializing PythonQt, which I guess means that something is going wrong? I'm going to compare against my working qmake build to see if this is the case there as well.Edit 3: My qmake build does NOT return false after initializing PythonQt, which means that something is amiss. I'm suspecting that PythonQt might not be getting access to Python like it needs. Although that'd be weird, since I'm using the same statically compiled library for both builds. It's very strange.
Last edit: Flower lady 2020-12-03