CellProfiler / python-javabridge

Python wrapper for the Java Native Interface
Other
21 stars 11 forks source link

Fix DLL imports for Python 3.8 #1

Closed DavidStirling closed 4 years ago

DavidStirling commented 4 years ago

As of Python 3.8, Windows will no longer search for .dll/.pyd files in PATH as per the link below. This was causing javabridge to struggle to import some essential files.

https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew

To solve this I've used the new os.add_dll_directory() function, which seems to fix the problems identified in LeeKamentsky/python-javabridge#177 and LeeKamentsky/python-javabridge#178. As this doesn't exist in 3.7 I've left the old functionality intact (in 3.8 it does nothing), as I'm not sure if this older python versions are still being supported.