awesome-panel / panel-chemistry

🧪📈 🐍. The purpose of the panel-chemistry project is to make it really easy for you to do DATA ANALYSIS and build powerful DATA AND VIZ APPLICATIONS within the domain of Chemistry using using Python and HoloViz Panel.
MIT License
119 stars 16 forks source link

ImportError: cannot import name 'string_types' from 'panel.util' #23

Closed MarcSkovMadsen closed 2 years ago

MarcSkovMadsen commented 2 years ago

When testing on panel 0.13.0rc5 I get

2022-04-07 21:06:14,769 Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x0000029BC5655100>: cannot import name 'string_types' from 'panel.util' (c:\repos\private\awesome-panel\.venv\lib\site-packages\panel\util.py)
File 'ngl_viewer.py', line 15, in <module>:
from panel.util import lazy_load, string_types Traceback (most recent call last):
  File "c:\repos\private\awesome-panel\.venv\lib\site-packages\bokeh\application\handlers\code_runner.py", line 231, in run
    exec(self._code, module.__dict__)
  File "C:\repos\private\awesome-panel\awesome_panel\apps\py3dmol.py", line 4, in <module>
    from panel_chemistry.pane import Py3DMol
  File "c:\repos\private\awesome-panel\.venv\lib\site-packages\panel_chemistry\pane\__init__.py", line 6, in <module>
    from .ngl_viewer import NGLViewer
  File "c:\repos\private\awesome-panel\.venv\lib\site-packages\panel_chemistry\pane\ngl_viewer.py", line 15, in <module>
    from panel.util import lazy_load, string_types
ImportError: cannot import name 'string_types' from 'panel.util' (c:\repos\private\awesome-panel\.venv\lib\site-packages\panel\util.py)
tubiana commented 2 years ago

Hi :-)

First of all thank you so much for your great pluggin =D I wanted to use it with Panel 0.13 (because of the great new notification system) and I also face this bug. While digging arround I realise it could be fixed by changing in ngl_viewer.py

from panel.util import lazy_load, string_types

by

from panel.util import lazy_load
from six import string_types

I made the changes and create a pull request --> #24 :-)

Best regards, Thibault.