Skip to content

AttributeError: module 'plotly' has no attribute 'subplots' #45

Closed
@clock-matt

Description

@clock-matt

Hi, sorry to keep bugging you. I had the below error today.

methplotlib -m guppy_out/sample0.bam -w CM025008.1:1-146 -n sample0 -f resources/Masked_Genome_061021.fa
Traceback (most recent call last):
File "/home/matthew/anaconda3/envs/methplotlib/bin/methplotlib", line 10, in
sys.exit(main())
File "/home/matthew/anaconda3/envs/methplotlib/lib/python3.9/site-packages/methplotlib/methplotlib.py", line 26, in main
meth_browser(meth_data=meth_data,
File "/home/matthew/anaconda3/envs/methplotlib/lib/python3.9/site-packages/methplotlib/methplotlib.py", line 89, in meth_browser
fig = utils.create_subplots(num_methrows, split=False, annotation=bool(bed or gtf))
File "/home/matthew/anaconda3/envs/methplotlib/lib/python3.9/site-packages/methplotlib/utils.py", line 261, in create_subplots
return plotly.subplots.make_subplots(
File "/home/matthew/anaconda3/envs/methplotlib/lib/python3.9/site-packages/_plotly_utils/importers.py", line 39, in getattr
raise AttributeError(
AttributeError: module 'plotly' has no attribute 'subplots'

Now according to the issue here:

plotly/plotly.py#2443

The plotly team changed how to import subplots from plotly, at least that is my interpretation. Not sure which release changed it, sometime between 4.7.1 and 5.5.

It sounds like if you add:

from plotly import subplots
from plotly.subplots import make_subplots

into utils.py, then it should work again.

I went ahead and tried adding it to my utils.py and that seems to have gotten rid of the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions