Reputation: 1
I am writing a code for making a graph and using the latest plotly version. Previously it wasn't working so I had to downgrade to 3.4.10 version of Plotly . Still getting this error. Any suggestions would be helpful. TIA!!
choromap = go.Figure(data=[data],layout =layout)
Used this command for running one of my programs and got this as an error.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-38-5fb62f726a1c> in <module>
----> 1 choromap = go.Figure(data=[data],layout =layout)
/opt/anaconda3/lib/python3.7/site-packages/plotly/graph_objs/_figure.py in __init__(self, data, layout, frames, skip_invalid, **kwargs)
606 is invalid AND skip_invalid is False
607 """
--> 608 super(Figure, self).__init__(data, layout, frames, skip_invalid, **kwargs)
609
610 def add_area(
/opt/anaconda3/lib/python3.7/site-packages/plotly/basedatatypes.py in __init__(self, data, layout_plotly, frames, skip_invalid, **kwargs)
197 # ### Import Layout ###
198 self._layout_obj = self._layout_validator.validate_coerce(
--> 199 layout, skip_invalid=skip_invalid
200 )
201
/opt/anaconda3/lib/python3.7/site-packages/_plotly_utils/basevalidators.py in validate_coerce(self, v, skip_invalid)
2442
2443 elif isinstance(v, dict):
-> 2444 v = self.data_class(v, skip_invalid=skip_invalid)
2445
2446 elif isinstance(v, self.data_class):
/opt/anaconda3/lib/python3.7/site-packages/plotly/graph_objs/__init__.py in __init__(self, arg, angularaxis, annotations, annotationdefaults, autosize, bargap, bargroupgap, barmode, barnorm, boxgap, boxgroupgap, boxmode, calendar, clickmode, coloraxis, colorscale, colorway, datarevision, direction, dragmode, editrevision, extendfunnelareacolors, extendpiecolors, extendsunburstcolors, extendtreemapcolors, font, funnelareacolorway, funnelgap, funnelgroupgap, funnelmode, geo, grid, height, hiddenlabels, hiddenlabelssrc, hidesources, hoverdistance, hoverlabel, hovermode, images, imagedefaults, legend, mapbox, margin, meta, metasrc, modebar, orientation, paper_bgcolor, piecolorway, plot_bgcolor, polar, radialaxis, scene, selectdirection, selectionrevision, separators, shapes, shapedefaults, showlegend, sliders, sliderdefaults, spikedistance, sunburstcolorway, template, ternary, title, titlefont, transition, treemapcolorway, uirevision, updatemenus, updatemenudefaults, violingap, violingroupgap, violinmode, waterfallgap, waterfallgroupgap, waterfallmode, width, xaxis, yaxis, **kwargs)
97544 self._validators[
97545 "extendtreemapcolors"
> 97546 ] = v_layout.ExtendtreemapcolorsValidator()
97547 self._validators["font"] = v_layout.FontValidator()
97548 self._validators["funnelareacolorway"] = v_layout.FunnelareacolorwayValidator()
AttributeError: module 'plotly.validators.layout' has no attribute 'ExtendtreemapcolorsValidator'
Upvotes: 0
Views: 3895
Reputation: 31
You need to install a new package chart-studio
. In your command line type and run:
pip install chart-studio
Then make sure you import it by running the code:
import chart_studio.plotly as py
Upvotes: 2