Very recently Plots/GR not working when run from a terminal, but OK in VSCode

I have long used Plots with the GR backend, but very recently it has stopped working when run from a terminal. Strangely, it works fine in VSCode when I launch Julia with Opt-J Opt-O.

(I also have no problem if I use the PyPlot backend.)

Here is information my Julia:

Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores

And here is what’s been happening:

julia> using Plots

julia> plot(cos,0,2pi)
dyld[12477]: Library not loaded: @rpath/QtWidgets
  Referenced from: <FB500667-2DEB-3842-818E-96B31DFFE76C> /Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/gksqt
  Reason: tried: '/workspace/destdir/lib/QtWidgets' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/./QtWidgets' (no such file), '/workspace/destdir/lib/QtWidgets' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtGui.framework/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtCore.framework/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtWidgets.framework/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtNetwork.framework/QtWidgets' (no such file), '/workspace/destdir/lib/QtWidgets' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/./QtWidgets' (no such file), '/workspace/destdir/lib/QtWidgets' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtGui.framework/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtCore.framework/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtWidgets.framework/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/Applications/gksqt.app/Contents/MacOS/../../../../lib/QtNetwork.framework/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/2a86ef020f132332b2f4be2fb40912cc7df5da29/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/92b949e2f3a66439c69a8d334fc95810fbd9df9b/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/5b338c8fa90c05e6faea86e54d2996cca76cfbbe/lib/QtWidgets' (no such file), '/Users/ers/.julia/juliaup/julia-1.9.3+0.aarch64.apple.darwin14/lib/julia/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/c7f903a3738cc550fb96a33e58e19560477152cb/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/9410bad2635eda2239b4a72ba4316c4aa8f5b76e/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/95f332911a8dd5ab82620ba58c217193bd0d515d/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/09f03e36eda588bb3a9ba375a1987f65e31538db/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/9a76a401f82e0e3cafce618fb8d2d5c307ab2836/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/b917751a0a1532e56881e471e0f9b441460f2295/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/c65e07e3da4f1bf519bc432389dbbd61df320457/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/4ec62d729213a748d2300dd0832ebe8ed2292093/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/e6b9fb44029423f5cd69e0cbbff25abcc4b32a8f/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/b2108f561a8812e376eb80e71a24a3678a24d231/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/ada2a202928dd4cb2fc4bd18c4efa9d5455ec742/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/df3881e810714d6a09467fe85a6fde79385fe702/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/3b3d0bcaf14a9b239a4f4dc20ef7b9e63030a47e/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/abf161ac3d4df76ae74bbf5432b7e061b3876236/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/4260cf51a368d8e305a5de3669e32539e1e6cc72/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/fc7ba632b72ce7d852c1924aa2bbfe244a71c780/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/413111420faa4e2aeaa383c075eaa213402d939c/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/ca2831bf6edc5088aec5b329ea98364951d6cad0/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/3fe6bf926e57cc4be598151cd40832221de2e894/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/c325a23bc1f6521474cef5f634f18c8ab311bb02/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/0db9c3f6cf936a0da49e2ba954ba3e10bed6ad72/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/1a7e22e66b523d9cb884cf85c3ec065b5fb3e5c3/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/595fba5dbc8bcce7dfc8c029dabcc7c184663ba8/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/4609432e7098d8434a7a4c7876dd5b9e09b2a5e7/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/bf37190b92ac2fc3dd5e7073ff7ec7bbfd10343f/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/7f4d1479db8bfb628aff3806c483e5fec617271a/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/9472204d25ab69d52d571b650fdc9d562455ca4a/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/b450526929615030746974fd622effa333c2c87a/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/5d7ac54565aa955be0d3ff53c9ccebff5422f807/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/9a9f59eab237f7454fee1d6ab112a254032540b7/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/2107e7bc404f11b178cb9724cb371ef704995727/lib/QtWidgets' (no such file), '/Users/ers/.julia/artifacts/808dd293d07b5fd6bdb12e6f00295ae83fd3c32c/lib/QtWidgets' (no such file), '/Users/ers/.julia/juliaup/julia-1.9.3+0.aarch64.apple.darwin14/bin/../lib/julia/QtWidgets' (no such file), '/Users/ers/.julia/juliaup/julia-1.9.3+0.aarch64.apple.darwin14/bin/../lib/QtWidgets' (no such file)
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
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
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
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
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
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
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
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
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 TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
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
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
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
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
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
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 TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE

Which GR version are you using? Did you try to update all packages? (] up)

(@v1.9) pkg> status GR
Status `~/.julia/environments/v1.9/Project.toml`
  [28b8d3ca] GR v0.72.9

And yes, I regularly update with ]up.

Thanks.

@barche

Same problem for me on Ubuntu 22.04…

Well, I have no idea what happened, but suddenly it’s working fine! I did an update, but the items changed did not involved Plots or GR.

Not working for me:

julia> using Plots

julia> plot(rand(3))
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: vkkhrdisplay, linuxfb, minimal, eglfs, vnc, offscreen, minimalegl.

Aborted (core dumped)
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
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
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
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
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
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
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 TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
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
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
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
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
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
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 TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE

on Ubuntu 22.04, no package but Plots installed, Julia 1.9.3.

I think this is because GR pulls in the recent Qt6Base v6.5.2, but I don’t understand why since we put in place a compat limit to avoid this.Or maybe the compat is too lenient here:

So until this is fixed doing add Qt6Base_jll@6.4.2 should work around this.

means from v6.4.2 to any following releases in the 6.x series.

1 Like

Yes, I think it misses a ~, this should fix it:Fix GR_jll Qt6Base_jll compat by barche · Pull Request #91635 · JuliaRegistries/General · GitHub

Working now, the jll was downgraded…