Skip to content

import plotly.graph_objects fails with ipywidget version is <= 7.0.0 #2264

Closed
@GaelVaroquaux

Description

@GaelVaroquaux

Steps to reproduce:

$ python3.7 -m venv test
$ . test/bin/activate
(test) $ pip install plotly
(test) $ pip install ipywidgets==6
(test) $ python -c "import plotly.graph_objects"
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/varoquau/tmp/clean_venv/test/lib/python3.7/site-packages/plotly/graph_objects.py", line 2, in 
    from plotly.graph_objs import *
AttributeError: module 'plotly.graph_objs' has no attribute 'FigureWidget'

The problem is on line 100184 of plotly/graph_objs/init.py: the __all__.append("FigureWidget") that is a few lines below should be moved under the "if" clause.

Given that it is generated code, I don't know how to fix it, so I won't send a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions