Handling PATH breakage on Windows with Python 3.8+ #1346
-
As of Python 3.8, PATH is no longer used for loading DLLs. https://docs.python.org/3.8/whatsnew/3.8.html#bpo-36085-whatsnew For packages that use PATH on Windows like LD_LIBRARY_PATH on Linux (all of mine are like this) I’m not really sure what to do to fix this. One option would be to write out a sitecustomize.py that adds all the dll paths and set USER_BASE to point to it. This will probably break in certain circumstances though. Another option would just be to static link everything on Windows. I really hope I’m just being stupid and overlooking something obvious here! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 15 replies
-
Libraries on PyPI just call os.add_dll_directory in their Other options are what you said (including all similar/derivative options) and you can also make sure the DLLs are in the same path as your Python code (if I'm not mistaken). But since this is more a question than an issue, I'll convert it to a discussion. |
Beta Was this translation helpful? Give feedback.
-
@christian-korneck good to know that's there as a nuclear option :D I agree I wish there was an environment variable to revert to the old behaviour... |
Beta Was this translation helpful? Give feedback.
Libraries on PyPI just call os.add_dll_directory in their
__init__.py
.Other options are what you said (including all similar/derivative options) and you can also make sure the DLLs are in the same path as your Python code (if I'm not mistaken).
But since this is more a question than an issue, I'll convert it to a discussion.