Est-il possible de compiler mon projet avec python3 avec pyqt5 avec cython ?
J'ai créé un fichier compyle.py avec ce contenu :
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [
Extension("Main", ["Main.py"]),
Extension("MainWindow", ["MainWindow.py"]),
Extension("CopyDialog", ["CopyDialog.py"]),
Extension("CopyDebugThread", ["CopyDebugThread.py"])
]
setup(
name = 'My Program Name',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
et je lance ce fichier avec ce commentaire selon ce :
python3 compile.py build_ext --inplace
Mais j'ai eu cette erreur :
$ python3 compile.py build_ext --inplace
running build_ext
cythoning Main.py to Main.c
/home/groot/.local/lib/python3.6/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/groot/PythonProject/ConfigServer/Main.py
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
from PyQt5.QtWidgets import QApplication
from MainWindow import MainWindowApp
app = QApplication(sys.argv)
mainWindow = MainWindowApp()
sys.exit(app.exec()) ^
------------------------------------------------------------
Main.py:7:13: Expected an identifier
building 'Main' extension
creating build
creating build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c Main.c -o build/temp.linux-x86_64-3.6/Main.o
Main.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
^~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Je pense que Cython peut compiler PyQt5
module ? Comment pourrais-je le faire ?