Closed
Description
First of all, thanks for working on this, I really appreciate these improvements from PyCall.
Seems like calling pyimport
from the top level of a module in precompiled code would create issues.
In PyCall, the following approach is recommended:
const scipy_opt = PyNULL()
function __init__()
copy!(scipy_opt, pyimport_conda("scipy.optimize", "scipy"))
end
end
I think the equivalent in PythonCall would be
const scipy_opt = pynew()
function __init__()
pycopy!(scipy_opt, pyimport("scipy.optimize"))
end
It would be worth documenting this somewhere. Obviously a lot of folks are going to be coming from PyCall (and will know to be mindful of this) but it would be better to make this fact explicit, or indicate that this isn't required.