# More v0.7 woes - cannot import Plots in notebook with more than one worker

**URL:** https://discourse.julialang.org/t/more-v0-7-woes-cannot-import-plots-in-notebook-with-more-than-one-worker/19259
**Category:** General Usage
**Tags:** question
**Created:** [January 4, 2019, 3:30am UTC](https://discourse.julialang.org/t/more-v0-7-woes-cannot-import-plots-in-notebook-with-more-than-one-worker/19259 "2019-01-04T03:30:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ronubi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronubi/32/4085_2.png) [@ronubi](https://discourse.julialang.org/u/ronubi)
#### Post date: [January 4, 2019, 3:30am UTC](https://discourse.julialang.org/t/more-v0-7-woes-cannot-import-plots-in-notebook-with-more-than-one-worker/19259/1 "2019-01-04T03:30:55Z")

</div>

I created a notebook kernel with two workers, and now cannot

```
import Plots

```

Here’s the error:

```julia
On worker 2:
InitError: LoadError: MethodError: no method matching show(::Base.PipeEndpoint, ::MIME{Symbol("text/html")}, ::String)
Closest candidates are:
  show(::IO, !Matched::MIME{Symbol("text/plain")}, ::Any) at sysimg.jl:195
  show(::IO, ::MIME{Symbol("text/html")}, !Matched::Method; kwtype) at methodshow.jl:241
  show(::IO, ::MIME{Symbol("text/html")}, !Matched::Base.MethodList) at methodshow.jl:290
  ...
display at ./multimedia.jl:211
display at ./multimedia.jl:301
display at ./multimedia.jl:179
top-level scope at /home/ubi/.julia/packages/Plots/ex9On/src/backends/plotly.jl:95
include at ./boot.jl:317 [inlined]
include_relative at ./loading.jl:1038
include at ./sysimg.jl:29 [inlined]
include at /home/ubi/.julia/packages/Plots/ex9On/src/Plots.jl:1 [inlined]
__init__ at /home/ubi/.julia/packages/Plots/ex9On/src/init.jl:2
_include_from_serialized at ./loading.jl:627
macro expansion at ./logging.jl:312 [inlined]
_require_search_from_serialized at ./loading.jl:698
_require at ./loading.jl:931
require at ./loading.jl:852
#2 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/Distributed.jl:77
#116 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/process_messages.jl:276
run_work_thunk at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/process_messages.jl:56
run_work_thunk at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/process_messages.jl:65
#102 at ./task.jl:262
in expression starting at /home/ubi/.julia/packages/Plots/ex9On/src/backends/plotly.jl:94
during initialization of module Plots
#remotecall_wait#154(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Distributed.Worker) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/remotecall.jl:407
remotecall_wait(::Function, ::Distributed.Worker) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/remotecall.jl:398
#remotecall_wait#157(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Int64) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/remotecall.jl:419
remotecall_wait(::Function, ::Int64) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/remotecall.jl:419
(::getfield(Distributed, Symbol("##1#3")){Base.PkgId})() at ./task.jl:262

...and 1 more exception(s).

Stacktrace:
 [1] sync_end(::Array{Any,1}) at ./task.jl:229
 [2] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/Distributed.jl:75 [inlined]
 [3] macro expansion at ./task.jl:247 [inlined]
 [4] _require_callback(::Base.PkgId) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Distributed/src/Distributed.jl:74
 [5] #invokelatest#1 at ./essentials.jl:691 [inlined]
 [6] invokelatest at ./essentials.jl:690 [inlined]
 [7] require(::Base.PkgId) at ./loading.jl:855
 [8] macro expansion at ./logging.jl:311 [inlined]
 [9] require(::Module, ::Symbol) at ./loading.jl:834
 [10] top-level scope at In[2]:1

```

I don’t even want to use the Plotly backend, and my next statement would be

```
Plots.gr()

```

I also don’t want to do plotting in parallel, just computation using `SharedArray` and the macros `@everywhere include ...` and `@sync @parallel for ...` later on in the notebook.

Please help!

Thanks in advance.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [January 4, 2019, 1:07pm UTC](https://discourse.julialang.org/t/more-v0-7-woes-cannot-import-plots-in-notebook-with-more-than-one-worker/19259/2 "2019-01-04T13:07:29Z")

</div>

Seems odd given that you say you’re not calling `@everywhere import Plots` (not sure whether behaviour is different in notebooks!?) but why not simply do:

```julia
import Plots
Plots.gr() # everything done on one process so far so should work

using Distributed, SharedArrays
addprocs(2)
# parallel computations start here

```

---

<div class="post-metadata">

### Author: ![ronubi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronubi/32/4085_2.png) [@ronubi](https://discourse.julialang.org/u/ronubi)
#### Post date: [January 4, 2019, 1:11pm UTC](https://discourse.julialang.org/t/more-v0-7-woes-cannot-import-plots-in-notebook-with-more-than-one-worker/19259/3 "2019-01-04T13:11:49Z")

</div>

Thanks for responding. I was under the impression that I had to use `IJulia.installkernel` to allow multiple workers in a notebook. If I can start up the notebook with the regular Julia-0.7 kernel, then `addprocs` later, that might solve my problem! I’ll try it now . . .

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [January 4, 2019, 1:13pm UTC](https://discourse.julialang.org/t/more-v0-7-woes-cannot-import-plots-in-notebook-with-more-than-one-worker/19259/4 "2019-01-04T13:13:34Z")

</div>

As far as I know this should work ([related IJulia issue](https://github.com/JuliaLang/IJulia.jl/issues/265))

---

<div class="post-metadata">

### Author: ![ronubi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronubi/32/4085_2.png) [@ronubi](https://discourse.julialang.org/u/ronubi)
#### Post date: [January 4, 2019, 1:45pm UTC](https://discourse.julialang.org/t/more-v0-7-woes-cannot-import-plots-in-notebook-with-more-than-one-worker/19259/5 "2019-01-04T13:45:54Z")

</div>

`Distributed.addprocs` works! Thanks.

I’m still getting warnings about calling `Base.@everywhere` even though I’m clearly calling `Distributed.@everywhere`. But my calculations appear to be correct and ran in parallel.

(I don’t like to use `using` because I’m still learning and want to be clear which versions of functions I’m running.)
