# Order matters when importing PyPlot and Plots, IJulia 1.18.1

**URL:** <https://discourse.julialang.org/t/order-matters-when-importing-pyplot-and-plots-ijulia-1-18-1/25147>\
**Category:** Visualization\
**Created:** [June 11, 2019, 2:09pm UTC](https://discourse.julialang.org/t/order-matters-when-importing-pyplot-and-plots-ijulia-1-18-1/25147 "2019-06-11T14:09:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maalaria](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@maalaria](https://discourse.julialang.org/u/maalaria)\
**Post date:** [June 11, 2019, 2:09pm UTC](https://discourse.julialang.org/t/order-matters-when-importing-pyplot-and-plots-ijulia-1-18-1/25147/1 "2019-06-11T14:09:06Z")

</div>

Dear all,

I want to use PyPlot and Plots in parallel in order to enable interactivity for certain plots in jupyterlab (Julia 1.1.1; IJulia 1.18.1). It seems that

```julia
import Plots, PyPlot
pygui(true)

```

leads to an error:

```julia
ArgumentError: invalid gui none

Stacktrace:
 [1] pygui(::Symbol) at /Users/mariusgorner/.julia/packages/PyCall/ttONZ/src/gui.jl:59
 [2] pygui_start(::Symbol, ::Float64) at /Users/mariusgorner/.julia/packages/PyCall/ttONZ/src/gui.jl:222 (repeats 2 times)
 [3] pygui(::Bool) at /Users/mariusgorner/.julia/packages/PyPlot/cdCMF/src/init.jl:211
 [4] top-level scope at In[1]:2

```

while

```julia
import PyPlot, Plots
pygui(true)

```

just works fine. This does not happen in the REPL.  
Is there another way to use the pygui directly from Plots frontend?

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [June 11, 2019, 5:13pm UTC](https://discourse.julialang.org/t/order-matters-when-importing-pyplot-and-plots-ijulia-1-18-1/25147/2 "2019-06-11T17:13:30Z")

</div>

I think in general this approach is not advisable because both packages export functions with the same name and you are not guaranteed that everything will work. I ended up using only PyPlot.jl when I need some low level access to PyPlot’s capabilities.

---

<div class="post-metadata">

**Author:** ![maalaria](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@maalaria](https://discourse.julialang.org/u/maalaria)\
**Post date:** [June 11, 2019, 7:02pm UTC](https://discourse.julialang.org/t/order-matters-when-importing-pyplot-and-plots-ijulia-1-18-1/25147/3 "2019-06-11T19:02:08Z")

</div>

Thanks. Yes, maybe that’s the best solution for now.
