# Plotting in windows?

**URL:** <https://discourse.julialang.org/t/plotting-in-windows/1847>\
**Category:** Visualization\
**Tags:** windows\
**Created:** [February 2, 2017, 6:25pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847 "2017-02-02T18:25:49Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 2, 2017, 6:25pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/1 "2017-02-02T18:25:49Z")

</div>

I’m having not having any luck for the backends in Plots under windows. I’ve tried pyplot, gr and plotlyjs.

i tend to get a lot of

\_show is not defined for this backend

Also too, pyplot is giving me a page full of errors on precomplitation.

I just need simply XY plots, could someone recommend a package that is known to be working under windows ?

Thanks!

---

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [February 2, 2017, 6:57pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/2 "2017-02-02T18:57:34Z")

</div>

I’ve seen the same error on my colleague’s computer and the issue seemed that she was not running Julia as administrator. I guess you could try running as admin and then rebuilding the plotting packages.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [February 2, 2017, 7:29pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/3 "2017-02-02T19:29:09Z")

</div>

Is this in Atom or in the REPL? What are the PyPlot errors? The Plots backends should all work under windows.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 3, 2017, 5:40am UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/4 "2017-02-03T05:40:37Z")

</div>

Hi

it is in the julia repl.  
I would love to get the error messages, but I can’t seem to copy out of the julia repl.  
there’s probably a way to create a transcript ?  
i will also try running it as admin.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [February 3, 2017, 6:25am UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/5 "2017-02-03T06:25:27Z")

</div>

Never had problems copying from the REPL. There is an issue copying from the Atom console, there you’d have to right-click the output.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 3, 2017, 5:58pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/6 "2017-02-03T17:58:22Z")

</div>

yep. when i highlight something and right click, copy is greyed out.  
i don’t have access to the machine right now.  
i’ll double-check all these things when i get back to it.

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 6, 2017, 4:52pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/7 "2017-02-06T16:52:47Z")

</div>

ok. so that’s weird. you have to enable “quick edit” mode for the window.  
i don’t remember having to ever do that before…

here’s what happens when i try to use the gr backend, via gr()

```julia
julia> plot(randn(10))
WARNING: _show is not defined for this backend. m=text/plain

```

and this is what happens when i try to use pyplot - by the way - i get the impression that python doesn’t actually need to be installed for pyplot backend to work. is that right ?

LoadError: PyCall not properly installed. Please run Pkg.build(“PyCall”)

I did that, and it seemed to work, so I tried plotting again:

```julia
INFO: Precompiling module PyPlot.
ImportError: No module named site
WARNING: Couldn't initialize pyplot. (might need to install it?)
INFO: To do a standard install of pyplot, copy and run this:

if !Plots.is_installed("PyPlot")
    Pkg.add("PyPlot")
end
withenv("PYTHON" => "") do
    Pkg.build("PyPlot")
end

ERROR: Failed to precompile PyPlot to C:\Users\user\.julia\lib\v0.5\PyPlot.ji.
 in compilecache(::String) at .\loading.jl:593
 in require(::Symbol) at .\loading.jl:422
 in _initialize_backend(::Plots.PyPlotBackend) at C:\Users\user\.julia\v0.5\Plo
ts\src\backends\pyplot.jl:62
 in backend() at C:\Users\user\.julia\v0.5\Plots\src\backends.jl:182
 in Plots.Plot{T<:Plots.AbstractBackend}() at C:\Users\user\.julia\v0.5\Plots\s
rc\types.jl:85
 in #plot#261 at C:\Users\user\.julia\v0.5\Plots\src\plot.jl:50 [inlined]
 in plot(::Array{Float64,1}) at C:\Users\user\.julia\v0.5\Plots\src\plot.jl:46

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [February 6, 2017, 4:57pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/8 "2017-02-06T16:57:00Z")

</div>

> [@purplishrock](#):
>
> ```julia
> if !Plots.is_installed("PyPlot")
> Pkg.add("PyPlot")
> end
> withenv("PYTHON" => "") do
> Pkg.build("PyPlot")
> end
> 
> ```

Did you run this? [20 char]

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 6, 2017, 7:31pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/9 "2017-02-06T19:31:22Z")

</div>

More than once.

```julia
INFO: Building Conda
INFO: Building PyCall
INFO: No system-wide Python was found; got the following error:
could not spawn `'' -c "import distutils.sysconfig; print(distutils.sysconfig.ge
t_config_var('VERSION'))"`: no such file or directory (ENOENT)
using the Python distribution in the Conda package
INFO: Downloading miniconda installer ...

```

Brian

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 15, 2017, 4:35pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/10 "2017-02-15T16:35:17Z")

</div>

ok. i fired up julia in windows to take another try at this and…both GR and pyplot are working.  
i could have sworn that i had restarted julia (more than once) while i was trying to debug this.  
apparently i didn’t or it would have worked.  
my advice is to make sure and install PyPlot and GR _before_ Plots  
That seems to make everything run a bit more smoothly.  
oh, and restart julia.

---

<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:** [February 15, 2017, 5:30pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/11 "2017-02-15T17:30:18Z")

</div>

> [@kristoffer.carlsson](#):
>
> ```julia
> withenv("PYTHON" =&gt; "") do
> Pkg.build("PyPlot")
> end
> 
> ```

Note that you don’t need to do `ENV["PYTHON"]=""` with PyCall anymore to get it to use it’s own Conda distro (which is more reliable than using whatever `python` it finds in the path). This is now the default on Mac and Windows.

---

<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:** [February 15, 2017, 5:31pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/12 "2017-02-15T17:31:34Z")

</div>

> [@purplishrock](#):
>
> INFO: Downloading miniconda installer …

You might be running into [broken install on 32-bit windows? · Issue #65 · JuliaPy/Conda.jl · GitHub](https://github.com/JuliaPy/Conda.jl/issues/65), which should be fixed if you do a `Pkg.update()`

---

<div class="post-metadata">

**Author:** ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Post date:** [February 15, 2017, 8:15pm UTC](https://discourse.julialang.org/t/plotting-in-windows/1847/13 "2017-02-15T20:15:01Z")

</div>

good grief. i’m just not with it today.  
ok. GR absolutely works.  
however pyplot was still not working.

i did an Pkg.update()

cut/pasted the add/build code that i keep seeing.

I saw a lot of stuff having to do with conda, lots of things were downloaded.

I then RESTARTED JULIA.

and success…

Finally.

Thanks very much for all the help.
