Using SymPy.jl inside a module

I got the ERROR: ArgumentError: ref of NULL PyObject when I call a function defined inside a module that is using SymPy.

seems like the situation is rather similar to this. Unfortunately I have difficulties to transform the solution into the one for SymPy.jl.

could anyone help? thanks.

after trial-and-errors, putting the following inside a module works:

import SymPy

### instead of:
# const sympy = SymPy.sympy    

### use the following:
import PyCall
const sympy = PyCall.PyNULL()
function __init__()
    copy!(sympy, PyCall.pyimport_conda("sympy", "sympy"))