Open programmeddeath1 opened 1 month ago
Use zip_include_packages: https://github.com/marcelotduarte/cx_Freeze/blob/main/samples/pyqt5/setup.py#L33
I cloned the repo and built the pyqt5 example using python3 setup,py build.
I then ran the test_pqt5 it gives me the same partially initialized error.
The PyQT i am using is the default PyQT5 installed at the system level in ubuntu 22.
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5 as pt
>>> pt.__path__
['/usr/lib/python3/dist-packages/PyQt5']
Could this be what is causing the conflict or issue? I am running ubuntu 22 on a orange pi sbc board. The pyqt app opens normally if i do python3 test_pyqt5.py.
Edit 1 I tried the same sample on my amd laptop too, its giving the same error, so it should not be a device or OS issue.
I have to use the system PyQt5 package because, on my sbc, the PyQT5 package cannot be installed through pip. It needs to be built from source.
Is it feasible to make cx_freeze use the system pip package? if so can you tell me the steps, else i assume I will have to try with a source build which currently doesnt seem feasible.
The program 'main_qthread_docker.py' runs in Python?
python3 main_qthread_docker.py
works?
I installed pyqt5-dev (sudo apt install pyqt5-dev)
And tried:
$ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5 as pt
>>> pt.__path__
_NamespacePath(['/usr/lib/python3/dist-packages/PyQt5'])
>>>
$ python3 samples/pyqt5/test_pyqt5.py
Traceback (most recent call last):
File "/home/marcelo/github/cx_Freeze/samples/pyqt5/test_pyqt5.py", line 5, in <module>
from PyQt5.QtCore import Qt
ModuleNotFoundError: No module named 'PyQt5.QtCore'
So the sample did not work with system python. This works w/ pyqt5 from pypi. Do I need more packages than pyqt5-dev?
I am trying to package a PyQt5 application with ROS dependencies. Below is my setup file -
It builds successfully. When I run the executable it fails with
Which means it has not properly inported the PyQt5 dependency, what am I doing wrong here? Thank you for your help in advance!