BjornNyberg / NetworkGT

The NetworkGT (Network Geometry and Topology) Toolbox is a set of tools designed for the geometrical and topological analysis of fracture networks.
GNU General Public License v3.0
32 stars 3 forks source link

Couldn't load plugin 'network_gt' due to an error when calling its classFactory() method #6

Closed Saijin-Naib closed 4 years ago

Saijin-Naib commented 4 years ago

It looks like chart-studio must be used instead of the plotly chart functions. I am unable to load/use NetworkGT due to this error.

ImportError: The plotly.plotly module is deprecated, please install the chart-studio package and use the chart_studio.plotly module instead. 
Traceback (most recent call last):
  File "C:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\network_gt\__init__.py", line 38, in classFactory
    from .network_gt import NetworkGTPlugin
  File "C:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\network_gt\network_gt.py", line 38, in 
    from .network_gt_provider import NetworkGTProvider
  File "C:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\network_gt\network_gt_provider.py", line 41, in 
    from .Line_Frequency import LineFrequency
  File "C:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\network_gt\Line_Frequency.py", line 20, in 
    import plotly.plotly as py
  File "C:/OSGeo4W64/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\plotly\plotly\__init__.py", line 4, in 
    _chart_studio_error("plotly")
  File "C:\OSGeo4W64\apps\Python37\lib\site-packages\_plotly_future_\__init__.py", line 49, in _chart_studio_error
    submodule=submodule
ImportError: 
The plotly.plotly module is deprecated,
please install the chart-studio package and use the
chart_studio.plotly module instead. 

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.10.1-A Coruña A Coruña, ef24c526da 

Python Path:
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\networks
C:/OSGeo4W64/apps/qgis/./python
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W64/apps/qgis/./python/plugins
C:\OSGeo4W64\bin\python37.zip
C:\OSGeo4W64\apps\Python37\DLLs
C:\OSGeo4W64\apps\Python37\lib
C:\OSGeo4W64\bin
C:\Users\username\AppData\Roaming\Python\Python37\site-packages
C:\OSGeo4W64\apps\Python37
C:\OSGeo4W64\apps\Python37\lib\site-packages
C:\OSGeo4W64\apps\Python37\lib\site-packages\win32
C:\OSGeo4W64\apps\Python37\lib\site-packages\win32\lib
C:\OSGeo4W64\apps\Python37\lib\site-packages\Pythonwin
C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python
BjornNyberg commented 4 years ago

Hi Saijin-Naib,

What version of plotly are you using? NetworkGT uses the QGIS version of plotly - version 3.3. In the future i foresee that QGIS will update to version 4 but at the moment this will cause a lot of compatibility issues.

Saijin-Naib commented 4 years ago

Bjorn,

I am using plotly 4.4.1 from PIP. I see that I have caused this problem.

Thanks for the heads up!