Skip to content

Commit

Permalink
fix dll load bug on windows from python3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwesky2010 committed Sep 15, 2020
1 parent 47fdc60 commit 6cdb767
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

1 comment on commit 6cdb767

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.