我从Python收到了一个错误信息:
Traceback (most recent call last):
File "stock_script.py", line 9, in <module>
from matplotlib.finance import candlestick
ImportError: cannot import name candlestick
为什么?我从Python收到了一个错误信息:
Traceback (most recent call last):
File "stock_script.py", line 9, in <module>
from matplotlib.finance import candlestick
ImportError: cannot import name candlestick
为什么?Matplotlib代码已经更改...
进入脚本并将“candlestick”替换为“candlestick_ohlc”
因此应该写成:
from matplotlib.finance import candlestick_ohlc
candlestick_ohlc(ax1, ...
from matplotlib.finance import candlestick_ohlc as candlestick
然后代码中不需要进行进一步更改。你需要在使用同一个库时在它前面加上下划线:
from matplotlib.finance import _candlestick
candlestick
没有正确安装? - Scott Hunter