chairemobilite / transition_qgis

MIT License
1 stars 4 forks source link

Unable to open plugin window (python Exception) #38

Closed davidmurray closed 4 months ago

davidmurray commented 4 months ago

I get this in the QGIS logs when I open the plugin window:

2024-07-09T13:57:02     WARNING    Traceback (most recent call last):
              File "C:\Users/damurray/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Transition-QGIS\transition_qgis.py", line 272, in show_dockwidget
              self.scenarios = self.transition_instance.get_scenarios()
              File "C:\Users\damurray\AppData\Roaming\Python\Python39\site-packages\pyTransition\transition.py", line 184, in get_scenarios
              response.raise_for_status()
              File "C:\PROGRA~1\QGIS33~1.3\apps\Python39\lib\site-packages\requests\models.py", line 941, in raise_for_status
              raise HTTPError(http_error_msg, response=self)
             requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://exo.transition.city/api/v1/scenarios

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "C:\Users/damurray/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Transition-QGIS\transition_qgis.py", line 231, in run
              self.show_dockwidget()
              File "C:\Users/damurray/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Transition-QGIS\transition_qgis.py", line 316, in show_dockwidget
              self.handleExpiredToken()
              File "C:\Users/damurray/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Transition-QGIS\transition_qgis.py", line 622, in handleExpiredToken
              self.onClosePlugin()
              File "C:\Users/damurray/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Transition-QGIS\transition_qgis.py", line 208, in onClosePlugin
              self.dockwidget.closingPlugin.disconnect(self.onClosePlugin)
             TypeError: 'method' object is not connected
tahini commented 4 months ago

@davidmurray just checking, do you have the latest version of the plugin?

davidmurray commented 4 months ago

@tahini What is the official way to upgrade the plugin? running pip in the QGIS python console or via the QGIS plugin registry?

tahini commented 4 months ago

In QGIS, you upgrade as you would upgrade any other plugin, but I don't think the python upgrade is automatic... You need to do whatever you did when you first installed it, that is some weird way for Windows users iirc.

davidmurray commented 4 months ago

OK, I updated the plugin through the QGIS registry and it opens correctly now. However, when clicking "calcul de chemin", QGIS freezes for 10 seconds, then unfreezes but nothing appears in the screen (no layers are added). Where are the plugin's logs located so I can check what's going on?

greenscientist commented 4 months ago

@davidmurray You should look for the Python Console, this is where you should see logs and error.

davidmurray commented 4 months ago

There was nothing there, but I restarted QGIS and everything seems to work fine now. Thanks!