Error when calling ScikitLearn from a function in a Package

This looks related,

I tried doing this, but is not working:

    using ScikitLearn, PyCall
    const LogisticRegression = PyNULL()
    function __init__()
        @eval global LogisticRegression = pyimport("linear_model")
    end

Gives this error:

  Got exception outside of a @test
  LoadError: InitError: PyError (PyImport_ImportModule
  
  The Python package linear_model could not be found by pyimport. Usually this means
  that you did not install linear_model in the Python version being used by PyCall.