JuliaPy / PythonCall.jl

Python and Julia in harmony.
https://juliapy.github.io/PythonCall.jl/stable/
MIT License
715 stars 61 forks source link

Add DLL Search Paths for Windows with Python 3.8+ #458

Closed thealanjason closed 4 months ago

thealanjason commented 4 months ago

Aims to Fix #457

thealanjason commented 4 months ago

Based on some further reading here I found that conda installs most DLLs to CONDA_PREFIX\\Library\\bin and adding this DLL search path should hopefully suffice. In conda, when we use the activate command, adding of the DLL search directory is taken care off. However, in PythonCall, we are using CondaPkg which internally uses MicroMamba, which does not handle this by default. This can be observed by issues: https://github.com/mamba-org/mamba/issues/2492, https://github.com/mamba-org/mamba/issues/2839. For now we could have this fix and delete it when micromamba fixes it upstream.

MilesCranmer commented 4 months ago

Looks good to me, thanks for implementing the suggestions. Now this will just need to wait for @cjdoris input :)

I should mention I am not that knowledgeable about Windows, so take my review with a grain of salt. It would be great if there was some way to unit-test the issue that this fix would solve (i.e., broken before this change; fixed after it), but I suppose it might not be possible.

thealanjason commented 4 months ago

I could surely write a Julia script based test for this.

cjdoris commented 4 months ago

Closing as per this comment https://github.com/JuliaPy/PythonCall.jl/issues/457#issuecomment-1951327848.