PLOTLY iplot gives get_config error()

Hi,
I am using plotly3.3.0 in Jupyter 5.2.3,conda 3 on Win 10 64bit

import plotly.plotly as py
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
plotly.tools.set_credentials_file(username=‘malavika8’,api_key=‘fBQHxA6nx77mchxoDuxf’)
init_notebook_mode(connected=True)
data = dict(type = ‘choropleth’,
locations = [‘AZ’,‘CA’,‘NY’],
locationmode = ‘USA-states’,
colorscale= ‘Portland’,
text= [‘text1’,‘text2’,‘text3’],
z=[1.0,2.0,3.0],
colorbar = {‘title’:‘Colorbar Title’})
layout = dict(geo = {‘scope’:‘usa’})
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap)

~\Anaconda3\lib\site-packages\plotly\offline\offline.py in _plot_html(figure_or_data, config, validate, default_width, default_height, global_requirejs)
221 # TODO: The get_config ‘source of truth’ should
222 # really be somewhere other than plotly.plotly
–> 223 plotly_platform_url = plotly.get_config().get(‘plotly_domain’,
224 ‘https://plot.ly’)
225 if (plotly_platform_url != ‘https://plot.ly’ and

AttributeError: module ‘plotly’ has no attribute ‘get_config’

Hi @malavika8,

I’m not sure why your plotly install isn’t finding the get_config function. It’s in there:

https://github.com/plotly/plotly.py/blob/defab4c7c668b7bd0c7b60d055733a8ccd959b36/plotly/plotly/init.py#L24

Could you add the output of conda list and pip list? Sometimes odd problems like this can crop up if you have plotly.py installed using both conda and pip, so double check that you don’t have a pip install as well.

-Jon

Hi Jon,

Thanks for your reply, I have been trying to fix this since yesterday,do u suggest i uninstall plotly and install again? Thanks

Yes, I’d recommend uninstalling from both pip and conda, and then reinstalling from conda only. Something like

$ pip uninstall plotly
$ conda uninstall plotly
$ conda install -c plotly plotly

Does that help?
-Jon

Hi Jon,
Yes that worked .Thanks!

1 Like