# How to use JuliaCall?

**URL:** <https://discourse.julialang.org/t/how-to-use-juliacall/86549>\
**Category:** General Usage\
**Tags:** juliacall\
**Created:** [August 30, 2022, 1:06pm UTC](https://discourse.julialang.org/t/how-to-use-juliacall/86549 "2022-08-30T13:06:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [August 30, 2022, 1:06pm UTC](https://discourse.julialang.org/t/how-to-use-juliacall/86549/1 "2022-08-30T13:06:23Z")

</div>

Hi,

I want to try `JuliaCall` but I’m finding the instructions extremely difficult to understand. This is my second attempt so I don’t remember well what I did in the first time. This time I managed to reach the point where I have this, which doesn’t look wrong since I want to try GMT.jl from Python.

```julia
>>> juliapkg.status(target=None)
JuliaPkg Status
C:\programs\miniconda3\juliapkg.json
Julia 1.8.0 @ C:\programs\julia-1.8\julia.BAT
Packages:
  GMT: {'uuid': '5752ebe1-31b9-557e-87aa-f909b540aa54'}

```

But now how do I use the package? I have done `from juliacall import Main as jl`, but now how I start using it? How to call its functions? All I get is errors like:

```julia
>>> jl.using("GMT")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\joaqu\.julia\packages\PythonCall\H8yA3\src\jlwrap\any.jl:167", line 18, in __getattr__
AttributeError: Julia: UndefVarError: using not defined

```

Thanks

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [August 30, 2022, 1:12pm UTC](https://discourse.julialang.org/t/how-to-use-juliacall/86549/2 "2022-08-30T13:12:52Z")

</div>

Looking at the documentation, it looks like you should actually try:

`from juliacall import GMT` rather than the `Main` module.  
Does that work any better?

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [August 30, 2022, 1:14pm UTC](https://discourse.julialang.org/t/how-to-use-juliacall/86549/3 "2022-08-30T13:14:23Z")

</div>

Thanks for looking but unfortunately, nope

```julia
>>> from juliacall import GMT
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'GMT' from 'juliacall' (C:\programs\miniconda3\lib\site-packages\juliacall\ __init__.py)

```

---

<div class="post-metadata">

**Author:** ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Post date:** [August 30, 2022, 2:16pm UTC](https://discourse.julialang.org/t/how-to-use-juliacall/86549/4 "2022-08-30T14:16:49Z")

</div>

```julia
jl.seval("using GMT")

```

seems to be the way it’s commonly done, for eg. the code in Step 4 of [this guide](https://github.com/moble/PostNewtonian.jl/blob/v0.5.0/docs/src/python.md#L33) for a different package says:

```julia
# Import `PostNewtonian` in the Julia session
jl.seval("using PostNewtonian")

```

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [August 30, 2022, 2:49pm UTC](https://discourse.julialang.org/t/how-to-use-juliacall/86549/5 "2022-08-30T14:49:55Z")

</div>

Thanks, that worked. This info should really be available right away on the installing/using instructions.
