havatv / qgisnnjoinplugin

GNU General Public License v2.0
7 stars 9 forks source link

Run crash in version 3.38 #38

Open leezn opened 2 weeks ago

leezn commented 2 weeks ago

执行Python代码时发生错误:

TypeError: setValue(self, value: int): argument 1 has unexpected type 'float' Traceback (most recent call last): File "C:\Users/leezn09/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\NNJoin\NNJoin_plugin.py", line 137, in run self.dlg.progressBar.setValue(0.0) TypeError: setValue(self, value: int): argument 1 has unexpected type 'float'

Python版本: 3.12.5 (main, Aug 8 2024, 11:21:54) [MSC v.1938 64 bit (AMD64)] QGIS版本: 3.38.2-Grenoble Grenoble, 130c432394

Python路径: C:\Users/leezn09/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\geohey_toolbox D:/leezn/QGIS33~1.2/apps/qgis/./python C:/Users/leezn09/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/leezn09/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins D:/leezn/QGIS33~1.2/apps/qgis/./python/plugins D:\leezn\QGIS33~1.2\apps\grass\grass84\etc\python C:\Users\leezn09\Documents D:\leezn\QGIS 3.38.2\bin\python312.zip D:\leezn\QGIS33~1.2\apps\Python312\DLLs D:\leezn\QGIS33~1.2\apps\Python312\Lib D:\leezn\QGIS 3.38.2\bin D:\leezn\QGIS33~1.2\apps\Python312 D:\leezn\QGIS33~1.2\apps\Python312\Lib\site-packages D:\leezn\QGIS33~1.2\apps\Python312\Lib\site-packages\win32 D:\leezn\QGIS33~1.2\apps\Python312\Lib\site-packages\win32\lib D:\leezn\QGIS33~1.2\apps\Python312\Lib\site-packages\Pythonwin C:/Users/leezn09/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users/leezn09/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing C:\Users\leezn09\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing C:\Users\leezn09\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing\ext_libs

BoyuanGIT commented 6 days ago

I encountered the same problem, here is how I solved it: 1.Locate the File: Navigate to the directory where the plugin is stored. According to the error message, the file is located at: C:\Users...\python\plugins\NNJoin\NNJoin_plugin.py 2.Open the File, Open NNJoin_plugin.py with a text editor that you are comfortable using, such as Notepad++, Visual Studio Code (WHAT I USE), or PyCharm. 3.Search for the line in the file where the error occurs. It should look like this: self.dlg.progressBar.setValue(0.0) 4.Change the float 0.0 to an integer 0 to ensure compatibility with the setValue() method, which expects an integer. Update the line to: self.dlg.progressBar.setValue(0) A restart of QGIS is needed. 哥们儿你自己翻译一下吧,反正就是把文件里那一行改成0,我问的chatgpt,修改完之后至少插件GUI出来了,后续还没测试。

leezn commented 4 days ago

I encountered the same problem, here is how I solved it: 1.Locate the File: Navigate to the directory where the plugin is stored. According to the error message, the file is located at: C:\Users...\python\plugins\NNJoin\NNJoin_plugin.py 2.Open the File, Open NNJoin_plugin.py with a text editor that you are comfortable using, such as Notepad++, Visual Studio Code (WHAT I USE), or PyCharm. 3.Search for the line in the file where the error occurs. It should look like this: self.dlg.progressBar.setValue(0.0) 4.Change the float 0.0 to an integer 0 to ensure compatibility with the setValue() method, which expects an integer. Update the line to: self.dlg.progressBar.setValue(0) A restart of QGIS is needed. 哥们儿你自己翻译一下吧,反正就是把文件里那一行改成0,我问的chatgpt,修改完之后至少插件GUI出来了,后续还没测试。

改了NNJoin_plugin.py的值,运行会报NNJoin_gui.py的错误,按照这个同理改,运行直接崩溃了