plotly.py: plotly.plotly import error message

Should have caught this before RC1, sorry… This message:

image

I think should provide a little more context and say something like:

The plotly.plotly module is deprecated.
To create figures using the Chart Studio service, please install the chart-studio package and use the chart_studio.plotly module instead. 
To create and display figures locally, please use the plotly.offline module which is based on the new version 4 rendering framework.

Basically give people more information and a stronger hint about using offline (which is arguably the smallest change to their code that lets them get on with their day)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 25 (7 by maintainers)

Most upvoted comments

@anki-code here is what worked for me: Downgraded from the latest plotly version pip install plotly==3.10.0

Hi @JobCollins, when using plotly version 4 (released two days ago) and error message here is the expected behavior. See https://plot.ly/python/v4-migration/ for the version 4 migration guide, or downgrade your plotly version to 3.10.

This issue is concerned with adding more information to the error message.

Hi @zShores, thanks for letting us know. The stack trace you’re getting is a bit confusing as it looks like import chart_studio.plotly as py is resulting in the import of plotly.plotly, which shouldn’t be happening. Could you try fully uninstalling and reinstalling the plotly and chart-studio packages to see if that makes a difference?

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

Hi @zShores, thanks for letting us know. The stack trace you’re getting is a bit confusing as it looks like import chart_studio.plotly as py is resulting in the import of plotly.plotly, which shouldn’t be happening. Could you try fully uninstalling and reinstalling the plotly and chart-studio packages to see if that makes a difference?

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

Hello Jonmease, I have the exact same issue described here and I attempted your solution but unfortunately it does not seem to be working for me.

Do you have any other suggestion for something I can try? I accidentally updated plotly, which started causing issues and so far attempting to revert it back did not fix it. Best B

@Zaid0 this is no longer necessary: if you install cufflinks version 0.17 it’s compatible with plotly 4.2+

thanks @JobCollins it worked for me

As one of Plotly fan, I am not happy at all. Everything crash each other.

Hi @anki-code, the documentation page you linked to (https://plot.ly/pandas/line-charts/) is written for version 3 only (See purple text box at the top). So downgrading to version 3 is what you would need to do to follow this example.

The error you’re getting indicates that there’s something corrupt in the installation. Try uninstalling and reinstalling the plotly package. Or better yet, create a new virtual environment.

@JobCollins after downgrade to 3.10.0 I’ve got a new error for “Pandas Basic Line Plot” (https://plot.ly/pandas/line-charts/) :

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-44cc9d35eca1> in <module>
     21 # py.iplot(data, filename='pandas/basic-line-plot')
     22 
---> 23 url = py.plot(data, filename='pandas/basic-line-plot')

AttributeError: module 'plotly.plotly' has no attribute 'plot'