# PyPlot woes in 1.8.0 Intel Mac

**URL:** https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138
**Category:** General Usage
**Tags:** pyplot
**Created:** [August 22, 2022, 2:13pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138 "2022-08-22T14:13:46Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)
#### Post date: [August 22, 2022, 2:13pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/1 "2022-08-22T14:13:47Z")

</div>

Running lates MAC OS. When I try to use PyPlot I get this

```julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.8.0 (2022-08-17)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using PyPlot
ERROR: InitError: UndefVarError: IJulia not defined
Stacktrace:
 [1] __init__ ()
   @ PyCall ~/.julia/packages/PyCall/g5hlI/src/pyinit.jl:260
 [2] _include_from_serialized(pkg::Base.PkgId, path::String, depmods::Vector{Any})
   @ Base ./loading.jl:831
 [3] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, sourcepath::String, depmods::Vector{Any})
   @ Base ./loading.jl:938
 [4] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
   @ Base ./loading.jl:1028
 [5] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1315
 [6] _require_prelocked(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1200
 [7] macro expansion
   @ ./loading.jl:1180 [inlined]
 [8] macro expansion
   @ ./lock.jl:223 [inlined]
 [9] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1144
during initialization of module PyCall

```

but when I do `using PyPlot` immediately afterwards it works fine. Any idea what is happening?

I have tried updating all packages, rebuilding IJulia, PyPlot, PyCall … with no luck.

I’ve been having `using IJulia` in my startup.jl file forever. When I take it out this problem goes away. Why?

---

<div class="post-metadata">

### Author: ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)
#### Post date: [August 22, 2022, 2:56pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/2 "2022-08-22T14:56:44Z")

</div>

Just tried rebuilding my .julia directory from scratch. Problem is still here.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [August 22, 2022, 2:57pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/3 "2022-08-22T14:57:32Z")

</div>

Which version are you using, or just do, to see if anything is holding you back from latest version:

```julia
(@v1.9) pkg> add IJulia@1.23.3

```

PyCall (and PyPlot) have some logic for IJulia:

[https://github.com/JuliaPy/PyCall.jl/blob/2728e20162db3c90198e2828c40e675924c73528/src/pyinit.jl#L260](https://github.com/JuliaPy/PyCall.jl/blob/2728e20162db3c90198e2828c40e675924c73528/src/pyinit.jl#L260)

What’s the difference between IJulia.jl and IPython.jl? I was trying to dig into this and by accident looked into the latter, and installing got a downgrade:

```julia
  [18364772] + IPython v0.5.1
    Updating `~/.julia/environments/v1.9/Manifest.toml`
⌅ [34da2185] ↓ Compat v4.2.0 ⇒ v3.46.0

```

It needs a compat entry for 4.0. Maybe something similar is happening for IJulia, and holding you back because you use some other package?

---

<div class="post-metadata">

### Author: ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)
#### Post date: [August 22, 2022, 3:03pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/4 "2022-08-22T15:03:53Z")

</div>

I think my IJulia is up to date.

```julia
(@v1.8) pkg> add IJulia@1.23.3
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.8/Project.toml`
  No Changes to `~/.julia/environments/v1.8/Manifest.toml`

```

On an M1 Macbook things work, but I get this everytime

```julia
julia> using PyPlot
[ Info: Installing matplotlib via the Conda matplotlib package...
[ Info: Running `conda install -y matplotlib` in root environment
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

Retrieving notices: ...working... done

```

Why does `conda install` run everytime?

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [August 22, 2022, 3:23pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/5 "2022-08-22T15:23:39Z")

</div>

I just pushed a bugfix. Should be tagged shortly, at which point you can do a package update: [https://github.com/JuliaRegistries/General/pull/66764](https://github.com/JuliaRegistries/General/pull/66764)

---

<div class="post-metadata">

### Author: ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)
#### Post date: [August 22, 2022, 3:24pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/6 "2022-08-22T15:24:39Z")

</div>

Things work in the repl if I put

```julia
using PyPlot
using IJulia

```

in my startup.jl file. If I swap the order I get the error message as when Julia starts up.

However, when I do that my notebooks can’t find the kernel.

---

<div class="post-metadata">

### Author: ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)
#### Post date: [August 22, 2022, 7:03pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/7 "2022-08-22T19:03:08Z")

</div>

After rebuilding .julia for the third time I found that `using TerminalPager` in my startup file seemed to be the problem.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [August 22, 2022, 7:56pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/8 "2022-08-22T19:56:25Z")

</div>

> [@ctkelley](#):
>
> After rebuilding .julia for the third time I found that `using TerminalPager` in my startup file seemed to be the problem.

I doubt it; probably you updated to the PyCall version that I [just registered](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/5) without noticing.

---

<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: [August 22, 2022, 8:30pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138/9 "2022-08-22T20:30:27Z")

</div>

> [@Palli](#):
>
> What’s the difference between IJulia.jl and IPython.jl?

IJulia is to install a Jupyter kernel that runs julia. IPython is to use Python from within the Julia REPL.
