Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run crash in version 3.38 #38

Open
leezn opened this issue Sep 14, 2024 · 2 comments
Open

Run crash in version 3.38 #38

leezn opened this issue Sep 14, 2024 · 2 comments

Comments

@leezn
Copy link

leezn commented Sep 14, 2024

执行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/QGIS331.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\QGIS331.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\QGIS331.2\apps\Python312\Lib
D:\leezn\QGIS 3.38.2\bin
D:\leezn\QGIS33
1.2\apps\Python312
D:\leezn\QGIS331.2\apps\Python312\Lib\site-packages
D:\leezn\QGIS33
1.2\apps\Python312\Lib\site-packages\win32
D:\leezn\QGIS331.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
Copy link

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
Copy link
Author

leezn commented Sep 23, 2024

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的错误,按照这个同理改,运行直接崩溃了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants