# Plots doesn't work properly

**URL:** <https://discourse.julialang.org/t/plots-doesnt-work-properly/48579>\
**Category:** New to Julia\
**Created:** [October 18, 2020, 10:03am UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579 "2020-10-18T10:03:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inbar\_Maimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inbar_maimon/32/18045_2.png) [@Inbar\_Maimon](https://discourse.julialang.org/u/Inbar_Maimon)\
**Post date:** [October 18, 2020, 10:03am UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579/1 "2020-10-18T10:03:53Z")

</div>

Hi there,  
I’m using Ubuntu 20.04 and julia 1.5.2.  
I’m trying to use Plots. When typing

```julia
using Plots

```

the julia terminal raises no complaints. Then I tried

```julia
plot(1:3, 1:3)

```

and got the message

```julia
/home/inbar/.julia/packages/GR/BwGt2/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA

```

and tens of other lines like the last one, with different routines. After that I tried running

```julia
gr()

```

and plot again, resulting in the first part of the message to disappear and the part with the routine failures to remain.  
What do I do wrong? Plots is a basic package, it doesn’t supposed to be that complicated to use it, is it?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [October 18, 2020, 10:12am UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579/2 "2020-10-18T10:12:27Z")

</div>

I cannot replicate this. Try restarting (a) the REPL and doing

```julia
julia> using Pkg
julia> Pkg.update()
julia> using Plots
julia> plot(1:3, 1:3)

```

if that does not work restart your machine, and try it again (without doing anything else first). If you still get the same error or some other error, let us see it and also show us what `versioninfo()` prints.

---

<div class="post-metadata">

**Author:** ![Inbar\_Maimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inbar_maimon/32/18045_2.png) [@Inbar\_Maimon](https://discourse.julialang.org/u/Inbar_Maimon)\
**Post date:** [October 18, 2020, 10:23am UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579/3 "2020-10-18T10:23:12Z")

</div>

using Pkg raised no remarks. Then:

```julia
julia> Pkg.update()
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
┌ Warning: Some registries failed to update:
│ — /home/inbar/.julia/registries/General — failed to fetch from repo
└ @ Pkg.Types /buildworker/worker/package_linux32/build/usr/share/julia/stdlib/v1.5/Pkg/src/Types.jl:1194
No Changes to `~/.julia/environments/v1.5/Project.toml`
No Changes to `~/.julia/environments/v1.5/Manifest.toml`

julia> using Plots

julia> plot(1:3, 1:3)
/home/inbar/.julia/packages/GR/BwGt2/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA

```

and so on tens of the like lines. Also after restart.

```julia
julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
  OS: Linux (i686-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
  WORD_SIZE: 32
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

```

---

<div class="post-metadata">

**Author:** ![Inbar\_Maimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inbar_maimon/32/18045_2.png) [@Inbar\_Maimon](https://discourse.julialang.org/u/Inbar_Maimon)\
**Post date:** [October 18, 2020, 10:29am UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579/4 "2020-10-18T10:29:43Z")

</div>

I add that in ~/.julia/packages/GR have only two folders: BwGt2 and cRdXQ. I saw somewhere a comment about a folder named crXzk, maybe it has some relevance?

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [October 18, 2020, 11:21am UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579/5 "2020-10-18T11:21:16Z")

</div>

It is not ok that `update` does not work. That indicates a problem which can have many ramifications, none easy to know. You could try `Pkg.resolve()` … though its a long shot. You are better off removing some of the installation, and putting it back fresh but I am not the person to guide you for that.

---

<div class="post-metadata">

**Author:** ![Inbar\_Maimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inbar_maimon/32/18045_2.png) [@Inbar\_Maimon](https://discourse.julialang.org/u/Inbar_Maimon)\
**Post date:** [October 18, 2020, 11:53am UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579/6 "2020-10-18T11:53:08Z")

</div>

OK, thanks.

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [October 18, 2020, 2:04pm UTC](https://discourse.julialang.org/t/plots-doesnt-work-properly/48579/7 "2020-10-18T14:04:56Z")

</div>

People in [https://github.com/JuliaPlots/Plots.jl/issues/1649](https://github.com/JuliaPlots/Plots.jl/issues/1649) report that adding qt5 solves that issue
