# Resolved: Plot() issue in REPL w/ GR & Qt - Linux Arch

**URL:** <https://discourse.julialang.org/t/resolved-plot-issue-in-repl-w-gr-qt-linux-arch/31237>\
**Category:** Tooling\
**Created:** [November 18, 2019, 8:54pm UTC](https://discourse.julialang.org/t/resolved-plot-issue-in-repl-w-gr-qt-linux-arch/31237 "2019-11-18T20:54:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pontus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pontus/32/10438_2.png) [@pontus](https://discourse.julialang.org/u/pontus)\
**Post date:** [November 18, 2019, 8:54pm UTC](https://discourse.julialang.org/t/resolved-plot-issue-in-repl-w-gr-qt-linux-arch/31237/1 "2019-11-18T20:54:51Z")

</div>

Stumbled on issue earlier today where Plot() failed in REPL using Linux Manjaro/Arch system, but could plot via a Jupyter notebook.  
Saw this issue in a number of places while searching for resolution, so thought would share the simple fix (that works for now, while `qt4` is still avail for Arch).

```julia
$ sudo pacman -Su qt4

```

error I was seeing before installing qt4:

```julia
julia> p = plot(1:10, rand(10))                                           
/home/e/.julia/packages/GR/f1Iqi/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
Did you start 'gksqt'?

GKS: Open failed in routine OPEN_WS

```

There is this announcement for dropping qt4 support from Arch, so concerned a bit for the future…  
[https://lists.archlinux.org/pipermail/arch-dev-public/2019-April/029560.html](https://lists.archlinux.org/pipermail/arch-dev-public/2019-April/029560.html)  
Github issue for this:  
[https://github.com/jheinen/GR.jl/issues/160](https://github.com/jheinen/GR.jl/issues/160)  
These all seem related: [GKS: Open failed in routine OPEN\_WS GKS · Issue #172 · jheinen/GR.jl · GitHub](https://github.com/jheinen/GR.jl/issues/172), [https://github.com/jheinen/GR.jl/issues/111](https://github.com/jheinen/GR.jl/issues/111) and [https://github.com/JuliaPlots/Plots.jl/issues/1649](https://github.com/JuliaPlots/Plots.jl/issues/1649) (saw that error as well).

Thanks!

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [November 19, 2019, 9:22am UTC](https://discourse.julialang.org/t/resolved-plot-issue-in-repl-w-gr-qt-linux-arch/31237/2 "2019-11-19T09:22:34Z")

</div>

The latest GR distribution for ArchLinux is built against Qt5 ([https://gr-framework.org/downloads/gr-latest-ArchLinux-x86\_64.tar.gz](https://gr-framework.org/downloads/gr-latest-ArchLinux-x86_64.tar.gz)). Could you please try the GR master branch:

```julia
ENV["GRDIR"]=""
] add GR#master
] build GR

```

---

<div class="post-metadata">

**Author:** ![pontus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pontus/32/10438_2.png) [@pontus](https://discourse.julialang.org/u/pontus)\
**Post date:** [November 19, 2019, 2:43pm UTC](https://discourse.julialang.org/t/resolved-plot-issue-in-repl-w-gr-qt-linux-arch/31237/3 "2019-11-19T14:43:14Z")

</div>

Thank you for your reply and attention to this matter, and all your work on the GR backend.  
First, I uninstalled qt4:

```julia
sudo pacman -Rs qt4

```

then updated the qt5 package to ensure that was ok:

```julia
sudo pacman -Su qt5

```

then validated that Plots was now broken again in the REPL:

```julia
/home/e/.julia/packages/GR/f1Iqi/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
Did you start 'gksqt'?

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
...
julia> p=Plots.plot(1:11, df)                                                                            
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
...

```

Next, from within Julia REPL, followed your instructions (cd to /home dir first). GR built just fine.  
Restarted the REPL and as a test:

```julia
using Plots ; gr()
data = rand(12)
p=Plots.plot(1:12, data)

```

Works perfectly!! 👍

Question: regarding the link you provided to the downloads. I pulled that down and unpacked the file. There isn’t a PKGBUILD file, but rather the four directories (bin, fonts, include, lib). Didn’t go further with that, but would the next step to install the c-libraries be to create an actual package? (if needed, clearly not for current purpose as plots from Julia is working as expected now). It seems the most recent version of GR on the Arch AUR is here, which is v0.18 from 2016: [https://aur.archlinux.org/packages/gr-git/](https://aur.archlinux.org/packages/gr-git/)  
I’ve never created a PKGBUILD file before (and don’t have the desire to do so now), but am just curious if that’s what would be done next (using the v0.18 as a reference) _ **if** _ one were so inclined.  
Thanks again!! 😄
