# Importing modules that depend on modules

**URL:** <https://discourse.julialang.org/t/importing-modules-that-depend-on-modules/42660>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 7, 2020, 6:43am UTC](https://discourse.julialang.org/t/importing-modules-that-depend-on-modules/42660 "2020-07-07T06:43:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonygem96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tonygem96/32/27564_2.png) [@tonygem96](https://discourse.julialang.org/u/tonygem96)\
**Post date:** [July 7, 2020, 6:43am UTC](https://discourse.julialang.org/t/importing-modules-that-depend-on-modules/42660/1 "2020-07-07T06:43:56Z")

</div>

I am fairly new to Julia and have ran into pickle when importing modules that are cross dependent. I have two modules A and B. In B, there is a function, Foo(), that takes a type, T , defined in A. Therefore I import A into B and then import A and B both into a parent module C which i use to include all the modules of my program. However when i try to call Foo I get a MethodError: no method matching Foo(::A.T)  
Closest candidates are:  
Foo(::B.A.T) at path to B

Any idea how I can get around this issue? All my modules are in separate files. I have added the path to LOAD\_PATH and have gotten rid of include completely but still no dice… Thanks!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 7, 2020, 8:16am UTC](https://discourse.julialang.org/t/importing-modules-that-depend-on-modules/42660/2 "2020-07-07T08:16:19Z")

</div>

You may be using a different `A`, but it is hard to say without code. Please post an MWE.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757/):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![tonygem96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tonygem96/32/27564_2.png) [@tonygem96](https://discourse.julialang.org/u/tonygem96)\
**Post date:** [July 9, 2020, 12:56pm UTC](https://discourse.julialang.org/t/importing-modules-that-depend-on-modules/42660/3 "2020-07-09T12:56:58Z")

</div>

I indeed had multiple copies of the same module. Fixed by making sure its only imported once. Thanks!
