<meta http-equiv="Content-Type" content="text/html; charset=GB18030"><div><br></div><div><div>Hello Phil,</div><div>I tried many times with diffirent ways, when I enabled the math module in standard library, the application report no module named math. </div><div><img src="cid:2FF8D814@1A023958.4843705E" modifysize="75%" diffpixels="16px" style="width: 595px; height: 457px;"></div><div><br></div><div>when I add math module as extension module , the compiler kept reporting mathmodule.obj error LNK2019 , please tell me how to import math module , thank you!</div><div><img src="cid:30F9D70F@9E22A924.4843705E" modifysize="70%" diffpixels="14px" scalingmode="zoom" style="width: 826px; height: 110px;"></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From:</b> "Phil Thompson"<phil@riverbankcomputing.com>;</div><div><b>Date:</b> Mon, Mar 16, 2020 08:11 PM</div><div><b>To:</b> "1004483092"<1004483092@qq.com>;<wbr></div><div><b>Cc:</b> "pyqt"<pyqt@riverbankcomputing.com>;<wbr></div><div><b>Subject:</b> Re: [PyQt] pyqtdeploy application on windows with math module</div></div><div><br></div>On 16/03/2020 10:41, 1004483092 wrote:<br>> Hello Phil,<br>> The math module build-in python use c modules , according to<br>> Python-3.7.2\setup.py , the math module information as below:<br>> shared_math = 'Modules/_math.o'<br>> # complex math library functions<br>> exts.append( Extension('cmath', ['cmathmodule.c'],<br>>                        extra_objects=[shared_math],<br>>                        depends=['_math.h', shared_math],<br>>                        libraries=['m']) )<br>> # math library functions, e.g. sin()<br>> exts.append( Extension('math',  ['mathmodule.c'],<br>>                        extra_objects=[shared_math],<br>>                        depends=['_math.h', shared_math],<br>>                        libraries=['m']) )<br>> <br>> <br>> Can you tell me how to import the math module on windows via<br>> pyqtdeploy? thank you!<br><br>Enable the module in the pyqtdeploy GUI.<br><br>Phil<br><br><br>> ------------------&nbsp;Original&nbsp;------------------<br>> From:&nbsp;"Phil Thompson"<phil@riverbankcomputing.com&gt;;<br>> Date:&nbsp;Mon, Mar 16, 2020 03:55 PM<br>> To:&nbsp;"1004483092"<1004483092@qq.com&gt;;<br>> Cc:&nbsp;"pyqt"<pyqt@riverbankcomputing.com&gt;;<br>> Subject:&nbsp;Re: [PyQt] pyqtdeploy application on windows with math <br>> module<br>> <br>> <br>> <br>> I have no idea what that DLL is. pyqtdeploy supports the standard <br>> Python<br>> math module. If you do not have lots of experience building and<br>> debugging C++ code on Windows then please use something else.<br>> <br>> Phil<br>> <br>> On 16/03/2020 03:37, 1004483092 wrote:<br>> &gt; Hello Phil,I build the demo on windows10 with VS2017 success <br>> according<br>> &gt; to the document , but when my python script include math module , <br>> the<br>> &gt; application can't import math module.The math module is<br>> &gt; api-ms-win-crt-math-l1-1-0.dll on windows , can you tell me how to<br>> &gt; import math module via pyqtdeploy?My scripyt as below:from<br>> &gt; PyQt5.QtCore import *<br>> &gt; from PyQt5.QtGui import *<br>> &gt; from PyQt5.QtWidgets import *<br>> &gt; import sys<br>> &gt; import mathclass Window(QWidget):<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp; def __init__(self):<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super().__init__()<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.setupUI()<br>> &gt;<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp; def setupUI(self):<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>> self.lb=QLabel(self)<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>> self.lb.setText('Label')<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>> self.lb.move(30,10)<br>> &gt;<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.btn =<br>> QPushButton('test',self)<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>> self.btn.move(30,30)<br>> &gt;<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.cb = <br>> QComboBox(self)<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>> self.cb.move(30,70)<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>> self.cb.resize(200,30)<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.resize(30,80)<br>> &gt;<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>> self.btn.clicked.connect(self.test_func)<br>> &gt;<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>> self.setWindowTitle('test')<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>> self.setGeometry(400, 400, 300, 300)&nbsp;&nbsp;&nbsp; def<br>> test_func(self):<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test1 =<br>> math.cos(30)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test2 =<br>> math.asinh(60)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test3 =<br>> &gt; math.exp(40.1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test4 =<br>> math.expm1(5.23)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test5 =<br>> &gt; math.factorial(40)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>> test6 = math.isfinite(3.24)<br>> &gt; self.cb.addItems([f'{test1}', f'{test2}', f'{test3}', f'{test4}',<br>> &gt; f'{test5}', f'{test6}'])if __name__=='__main__':<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp; app = QApplication(sys.argv)<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp; window=Window()<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp; window.show()<br>> &gt;&nbsp;&nbsp;&nbsp;&nbsp; sys.exit(app.exec_())<br>> &gt; _______________________________________________<br>> &gt; PyQt mailing list&nbsp;&nbsp;&nbsp; PyQt@riverbankcomputing.com<br>> &gt; https://www.riverbankcomputing.com/mailman/listinfo/pyqt<br><br></div>