-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix windows dll search path in python 3.8 #18362
Conversation
Hey @yajiedesign , Thanks for submitting the PR
CI supported jobs: [sanity, windows-gpu, miscellaneous, unix-cpu, centos-gpu, centos-cpu, edge, windows-cpu, unix-gpu, website, clang] Note: |
@mxnet-bot run ci [ci/jenkins/mxnet-validation/miscellaneous] |
None of the jobs entered are supported. |
@mxnet-bot run ci [miscellaneous] |
Jenkins CI successfully triggered : [miscellaneous] |
@mxnet-bot run ci [miscellaneous] |
Jenkins CI successfully triggered : [miscellaneous] |
@@ -73,6 +73,11 @@ def find_lib_path(prefix='libmxnet'): | |||
'List of candidates:\n' + str('\n'.join(dll_path))) | |||
if os.name == 'nt': | |||
os.environ['PATH'] = os.environ['PATH'] + ';' + os.path.dirname(lib_path[0]) | |||
if sys.version_info >= (3, 8): | |||
if 'CUDA_PATH' not in os.environ: | |||
raise RuntimeError('Cannot find the env CUDA_PATH.Please set CUDA_PATH env with cuda path') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thus mxnet won't work on Windows as long as users don't set up this environment variable? Or is it provided by default by cuda?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cuda default provided.
@@ -73,6 +73,11 @@ def find_lib_path(prefix='libmxnet'): | |||
'List of candidates:\n' + str('\n'.join(dll_path))) | |||
if os.name == 'nt': | |||
os.environ['PATH'] = os.environ['PATH'] + ';' + os.path.dirname(lib_path[0]) | |||
if sys.version_info >= (3, 8): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more pythonic to use try-except syntax and just attempt to call add_dll_directory
It will ensure compatibility with interpreters different to cpython
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the version here because only 3.8 or above needs to call this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nevertheless bad practice as there are other python interpreters with different versioning schemes
Description
fix windows dll search path in python 3.8
Reference
https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew
Changes
Comments