未验证 提交 59ab98c9 编写于 作者: W wopeizl 提交者: GitHub

Merge pull request #15440 from wopeizl/windows/fixprompt

fix the prompt when dll load failed on windows
...@@ -37,11 +37,13 @@ try: ...@@ -37,11 +37,13 @@ try:
from . import core from . import core
except ImportError as e: except ImportError as e:
if os.name == 'nt': if os.name == 'nt':
executable_path = os.path.abspath(os.path.dirname(sys.executable))
raise ImportError( raise ImportError(
"""NOTE: You may need to run \"set PATH=c:\python27\lib:%PATH%\" """NOTE: You may need to run \"set PATH=%s;%%PATH%%\"
if you encounters \"mkldnn.dll not found\" errors. If you have python if you encounters \"DLL load failed\" errors. If you have python
installed in other directory, replace \"c:\python27\lib" with your own installed in other directory, replace \"%s\" with your own
directory. The original error is: \n""" + cpt.get_exception_message(e)) directory. The original error is: \n %s""" %
(executable_path, executable_path, cpt.get_exception_message(e)))
else: else:
raise ImportError( raise ImportError(
"""NOTE: You may need to run \"export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH\" """NOTE: You may need to run \"export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH\"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册