# Module does'nt find other modules by the keyword using

**URL:** <https://discourse.julialang.org/t/module-doesnt-find-other-modules-by-the-keyword-using/93625>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [January 27, 2023, 12:00pm UTC](https://discourse.julialang.org/t/module-doesnt-find-other-modules-by-the-keyword-using/93625 "2023-01-27T12:00:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [January 27, 2023, 12:00pm UTC](https://discourse.julialang.org/t/module-doesnt-find-other-modules-by-the-keyword-using/93625/1 "2023-01-27T12:00:52Z")

</div>

Hello, good morning. I’m having an issue building a custom module, that I’ll use to automate some things for machine learning. There are functions in my module that cant find another modules present in the environtment:

```julia
using GLM, DataFrames, CSV; 
using StatsModels: TableRegressionModel, StatisticalModel;

module SampleModule
	export testfunction;
	export IntPoint;
	export r2;
	
	struct IntPoint
		x::Int64
		y::Int64
	end

	"""
		testfunction()

	This function does nothing.

	# This is a tile
	## This is a subtitle
	### This is a section
	"""
	function testfunction()
		println("this is a simple function");
	end

	function r2(model)::Float64
		beta0, beta1 = GLM.coef(model)
	end
end

```

And when I will use it in the environment as:

```julia
julia> include("sample.jl")
julia> using .SampleModule

```

I got the following error:

```julia
julia> SampleModule.r2(model)
ERROR: UndefVarError: GLM not defined
Stacktrace:
 [1] r2(model::TableRegressionModel{GeneralizedLinearModel{GLM.GlmResp{Vector{Float64}, Binomial{Float64}, ProbitLink}, GLM.DensePredChol{Float64, LinearAlgebra.CholeskyPivoted{Float64, Matrix{Float64}, Vector{Int64}}}}, Matrix{Float64}})
   @ Main.SampleModule C:\Users\jcbri\Documents\Workspace\julia\explore\sample.jl:28
 [2] top-level scope
   @ REPL[50]:1

```

What I’m missing?

---

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [January 27, 2023, 12:34pm UTC](https://discourse.julialang.org/t/module-doesnt-find-other-modules-by-the-keyword-using/93625/2 "2023-01-27T12:34:02Z")

</div>

> [@jcbritobr](#):
>
> ```julia-auto
> using GLM, DataFrames, CSV; 
> using StatsModels: TableRegressionModel, StatisticalModel;
> 
> ```

Got it here. It needs to be included inside the module declararion

```julia-auto
...
module X
using GLM, DataFrames, CSV; 
using StatsModels: TableRegressionModel, StatisticalModel;
...
end

```
