LoadError: UndefVarError `Normal` not defined

The following Julia code produces the error specified in the title of this post:

import Random

Random.Normal(0.0, 1.0)

However, the following code works:

using Random

Normal(0.0, 1.0)

I thought that import performed a very similar function to using, the difference being that module exported names are not brought into the current scope.

Can someone clarify? I was trying to write code which would require the use of fully qualified names, prefixed by the module name.

Normal is not from the Random stdlib; are you thinking of Distributions.jl?

4 Likes

sorry - noob error - thank you for fixing my problem

1 Like