Skip to content

Commit

Permalink
fix dll load bug on windows from python3.8 (#27324)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwesky2010 authored Sep 17, 2020
1 parent d4b4357 commit a7fadce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/paddle/fluid/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
third_lib_path = current_path + os.sep + '..' + os.sep + 'libs'
os.environ['path'] = third_lib_path + ';' + os.environ['path']
sys.path.insert(0, third_lib_path)
# Note: from python3.8, PATH will not take effect
# https://github.com/python/cpython/pull/12302
# Use add_dll_directory to specify dll resolution path
if sys.version_info[:2] >= (3, 8):
os.add_dll_directory(third_lib_path)

except ImportError as e:
from .. import compat as cpt
Expand Down

0 comments on commit a7fadce

Please sign in to comment.