Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
clock-matt opened this issue Feb 24, 2023 · 1 comment
Closed

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

clock-matt opened this issue Feb 24, 2023 · 1 comment

Comments

@clock-matt
Copy link

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.

@wdecoster
Copy link
Owner

No worries - happy with any feedback. Do you want to open a pull request for this change?

@sbecuwe sbecuwe mentioned this issue Feb 24, 2023
wdecoster added a commit that referenced this issue Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants