@pyimport numpy throwing an error when precompiling a module

From the PyCall documentation, it looks like you need to do the actual python imports inside your module’s __init__ method (which is called when the module is loaded rather than when it’s precompiled). Check out the example at the end of this section: GitHub - JuliaPy/PyCall.jl: Package to call Python functions from the Julia language