Skip to content

Commit 59ab98c

Browse files
author
wopeizl
authored
Merge pull request #15440 from wopeizl/windows/fixprompt
fix the prompt when dll load failed on windows
2 parents 266e625 + 5e5e6a3 commit 59ab98c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

python/paddle/fluid/framework.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
from . import core
3838
except ImportError as e:
3939
if os.name == 'nt':
40+
executable_path = os.path.abspath(os.path.dirname(sys.executable))
4041
raise ImportError(
41-
"""NOTE: You may need to run \"set PATH=c:\python27\lib:%PATH%\"
42-
if you encounters \"mkldnn.dll not found\" errors. If you have python
43-
installed in other directory, replace \"c:\python27\lib" with your own
44-
directory. The original error is: \n""" + cpt.get_exception_message(e))
42+
"""NOTE: You may need to run \"set PATH=%s;%%PATH%%\"
43+
if you encounters \"DLL load failed\" errors. If you have python
44+
installed in other directory, replace \"%s\" with your own
45+
directory. The original error is: \n %s""" %
46+
(executable_path, executable_path, cpt.get_exception_message(e)))
4547
else:
4648
raise ImportError(
4749
"""NOTE: You may need to run \"export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH\"

0 commit comments

Comments
 (0)