matplotlib版本兼容引起的ImportError
最新版的Anaconda的默认Python版本是3.6,安装Hikyuu后,出现“ImportError: DLL load failed: 找不到指定的程序。”错误,错误信息如下:
d:\workspace\hikyuu>python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from hikyuu.interactive.interactive import *
warning: can't import talib, maybe loss some Indicator from talib!
ERROR:lml.utils:failed to import pyecharts_snapshot
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\lml\utils.py", line 43, in do_import
plugin_module = __import__(plugin_module_name)
ModuleNotFoundError: No module named 'pyecharts_snapshot'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "d:\workspace\hikyuu\hikyuu\interactive\__init__.py", line 32, in <module>
from .drawplot import (use_draw_engine,
File "d:\workspace\hikyuu\hikyuu\interactive\drawplot\__init__.py", line 51, in <module>
from matplotlib.pylab import gca as mpl_gca
File "C:\Anaconda3\lib\site-packages\matplotlib\pylab.py", line 257, in <module>
from matplotlib import cbook, mlab, pyplot as plt
File "C:\Anaconda3\lib\site-packages\matplotlib\pyplot.py", line 32, in <module>
import matplotlib.colorbar
File "C:\Anaconda3\lib\site-packages\matplotlib\colorbar.py", line 36, in <module>
import matplotlib.contour as contour
File "C:\Anaconda3\lib\site-packages\matplotlib\contour.py", line 21, in <module>
import matplotlib.font_manager as font_manager
File "C:\Anaconda3\lib\site-packages\matplotlib\font_manager.py", line 58, in <module>
from matplotlib import afm, cbook, ft2font, rcParams, get_cachedir
ImportError: DLL load failed: 找不到指定的程序。
>>> quit()
该错误为matplotlib版本错误,可通过更新matplotlib至最新版本解决,命令如下:
pip install matplotlib -U
缺失库pyperclip和pyecharts_snapshot
错误提示如下:
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from hikyuu.interactive.interactive import *
warning: can't import talib, maybe loss some Indicator from talib!
ERROR:lml.utils:failed to import pyecharts_snapshot
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\lml\utils.py", line 43, in do_import
plugin_module = __import__(plugin_module_name)
ModuleNotFoundError: No module named 'pyecharts_snapshot'
std::cout are redirected to python::stdout
std::cerr are redirected to python::stderr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "d:\workspace\hikyuu\hikyuu\interactive\interactive.py", line 69, in <module>
from .puppet import *
File "d:\workspace\hikyuu\hikyuu\interactive\puppet.py", line 14, in <module>
import pyperclip
ModuleNotFoundError: No module named 'pyperclip'
>>> quit()
安装pyperclip、pyecharts_snapshot:
pip install pyperclip
pip install pyecharts_snapshot