You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from 3.7.1 to 3.8.1 (as installed via pip/PyPI), simple plots break with UnboundLocalError: local variable 'config_dict' referenced before assignment.
Minimum working example:
importplotly.graph_objsasgogo.Figure()
Expected behavior: a Figure should be returned.
Figure({
'data': [], 'layout': {}
})
I'm running macOS and Python 3.7.0. Downgrading to plotly 3.7.1 is a workaround: sudo pip3 install plotly=3.7.1.
Stack trace:
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
<ipython-input-1-0c49f1f32fec> in <module>()
1 import plotly.graph_objs as go
2
----> 3 go.Figure()
/usr/local/lib/python3.7/site-packages/plotly/graph_objs/_figure.py in __init__(self, data, layout, frames, skip_invalid)
501 is invalid AND skip_invalid is False
502 """
--> 503 super(Figure, self).__init__(data, layout, frames, skip_invalid)
504
505 def add_area(
/usr/local/lib/python3.7/site-packages/plotly/basedatatypes.py in __init__(self, data, layout_plotly, frames, skip_invalid)
196 # options are compatible with FigureWidget.
197 from plotly.offline.offline import _get_jconfig
--> 198 self._config = _get_jconfig(None)
199
200 # Frames
/usr/local/lib/python3.7/site-packages/plotly/offline/offline.py in _get_jconfig(config)
160 clean_config = {}
161
--> 162 plotly_platform_url = plotly.tools.get_config_plotly_server_url()
163
164 clean_config['plotlyServerURL'] = plotly_platform_url
/usr/local/lib/python3.7/site-packages/plotly/tools.py in get_config_plotly_server_url()
1286 data = {}
1287
-> 1288 return config_dict.get('plotly_domain', default_server_url)
1289
1290
UnboundLocalError: local variable 'config_dict' referenced before assignment
I observe the same behavior with more involved go.Figure() calls, such as the following:
Thanks a lot for the report @SigmaX, it looks like this error would crop up when the ~/.plotly/.config file is not found or not loaded successfully. #1551 should take care of it.
After upgrading from 3.7.1 to 3.8.1 (as installed via
pip
/PyPI), simple plots break withUnboundLocalError: local variable 'config_dict' referenced before assignment
.Minimum working example:
Expected behavior: a
Figure
should be returned.I'm running macOS and Python 3.7.0. Downgrading to plotly 3.7.1 is a workaround:
sudo pip3 install plotly=3.7.1
.Stack trace:
I observe the same behavior with more involved
go.Figure()
calls, such as the following:The text was updated successfully, but these errors were encountered: