wdecoster / NanoPlot

Plotting scripts for long read sequencing data
http://nanoplot.bioinf.be
MIT License
413 stars 47 forks source link

AttributeError: module 'plotly' has no attribute 'to_json' #233

Closed wlchen1 closed 3 years ago

wlchen1 commented 3 years ago

Script to run: NanoPlot --fastq /home/xgmao/data_from_chen/PAF28254.fastq.gz -o /home/students/2_wlchen/1_qc_results -t 12

got this error :

`If you read this then NanoPlot 1.33.0 has crashed :-( Please try updating NanoPlot and see if that helps...

If not, please report this issue at https://github.com/wdecoster/NanoPlot/issues If you could include the log file that would be really helpful. Thanks!

Traceback (most recent call last): File "/home/students/anaconda3/bin/NanoPlot", line 11, in load_entry_point('NanoPlot==1.33.0', 'console_scripts', 'NanoPlot')() File "/home/students/anaconda3/lib/python3.6/site-packages/NanoPlot-1.33.0-py3.6.egg/nanoplot/N plots = make_plots(datadf, settings) File "/home/students/anaconda3/lib/python3.6/site-packages/NanoPlot-1.33.0-py3.6.egg/nanoplot/N title=settings["title"]) File "/home/students/anaconda3/lib/python3.6/site-packages/NanoPlot-1.33.0-py3.6.egg/nanoplotte plots.append(dynamic_histogram(array=array, name=name, path=path, title=title, color=color)) File "/home/students/anaconda3/lib/python3.6/site-packages/NanoPlot-1.33.0-py3.6.egg/nanoplotteam dynhist.save() File "/home/students/anaconda3/lib/python3.6/site-packages/NanoPlot-1.33.0-py3.6.egg/nanoplotte self.save_static() File "/home/students/anaconda3/lib/python3.6/site-packages/NanoPlot-1.33.0-py3.6.egg/nanoplotte f.write(scope.transform(self.fig, format="png")) File "/home/students/anaconda3/lib/python3.6/site-packages/kaleido/scopes/plotly.py", line 154, figure, format=format, width=width, height=height, scale=scale File "/home/students/anaconda3/lib/python3.6/site-packages/kaleido/scopes/base.py", line 296, i export_spec = self._json_dumps(dict(kwargs, data=data)).encode('utf-8') File "/home/students/anaconda3/lib/python3.6/site-packages/kaleido/scopes/plotly.py", line 76, return pio.to_json(val, validate=False, remove_uids=False) AttributeError: module 'plotly' has no attribute 'to_json'`

I have replaced different versions of the software, but they all have similar errors. Thanks for your help!

wdecoster commented 3 years ago

Could you let me know the version of your plotly library?

python -c "import plotly ; print(plotly.__version__)"

wlchen1 commented 3 years ago

4.14.3

wdecoster commented 3 years ago

@iliasbukraa could you add a try-except AttributeError block around the call to the save_static() method of Plot instances? It seems plotly/kaleido has some version-compatibility issues and I don't want NanoPlot to crash whenever they mess up. You can just log it as a warning and move on without static plots.

wdecoster commented 3 years ago

@wlchen1 we will soon make the next version available, which should not crash on this plotly issue.

wlchen1 commented 3 years ago

OK, Thanks.Looking forward to the update of the new version

wdecoster commented 3 years ago

Thanks for your patience, through pip you can now install NanoPlot 1.35.0. Please let us know if you still experience issues.