backtrader绘图运行出matplotlib错?你想不到的坑

不少朋友运行backtrader回测程序,调用cerebro.plot()命令时,会出如下错误
cannot import name ‘warnings’ from ‘matplotlib.dates’
左查又查找不到原因。其实原因可能很简单,就是matplotlib版本不兼容。backtrader与matplot 3.3不兼容,要降级到3.2,运行如下命令可降级:
pip uninstall matplotlib
pip install matplotlib==3.2.2

需要backtrader技术教程请点

猜你喜欢

转载自blog.csdn.net/qtbgo/article/details/109687577
今日推荐