Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix Win Environ "PATH" does not exists Bug (#18402)
Browse files Browse the repository at this point in the history
When "PATH" are not in the environment, we will get error when reading os.environ['PATH'].
Change to os.environ.get('PATH', '') to fix it.
  • Loading branch information
chinakook authored May 25, 2020
1 parent 9c2c5d4 commit b2336b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/mxnet/libinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def find_lib_path(prefix='libmxnet'):
elif os.name == "posix" and os.environ.get('LD_LIBRARY_PATH', None):
dll_path[0:0] = [p.strip() for p in os.environ['LD_LIBRARY_PATH'].split(":")]
if os.name == 'nt':
os.environ['PATH'] = os.path.dirname(__file__) + ';' + os.environ['PATH']
os.environ['PATH'] = os.path.dirname(__file__) + ';' + os.environ.get('PATH', '')
dll_path = [os.path.join(p, prefix + '.dll') for p in dll_path]
elif platform.system() == 'Darwin':
dll_path = [os.path.join(p, prefix + '.dylib') for p in dll_path] + \
Expand Down

0 comments on commit b2336b6

Please sign in to comment.