Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Plots with GR on Mac OS stopped working at all #3800

Closed
kellertuer opened this issue Sep 11, 2021 · 10 comments
Closed

[BUG] Plots with GR on Mac OS stopped working at all #3800

kellertuer opened this issue Sep 11, 2021 · 10 comments
Labels
bug GR upstream julia or dependencies

Comments

@kellertuer
Copy link
Contributor

As a continuation of https://discourse.julialang.org/t/plots-broken-on-mac/65551/9 – I am facing a similar issue that I do not seem to be able to resolve (and I am not sure whether its Plots or GR either).

I get the error message

ERROR: LoadError: SystemError: opening file "/var/folders/q4/7mgqym9s5nx0kq4jx_z40wj00000gn/T/jl_AtKYms.png": No such file or directory

when running code with Plots/GR inside

  • On both Julia 1.6.0
  • On both most recent GR and 0.48
  • Mac OS Big Sur (M1)

things I further tried

  • deleting all artefacts
  • deleting Plots and GR (] rm Plots, GR) and adding them back again
  • deleting Juila and installing Julia again

The only thing I can additionally provide, is that on most recent GR, it also prints

objc[12652]: Class RunLoopModeTracker is implemented in both /Users/ronny/.julia/conda/3/lib/libQt5Core.5.9.7.dylib (0x1a97d5a80) and .julia/artifacts/d594d9e68b9d104aaf1a41d933728d2dad54c869/lib/QtCore.framework/Versions/5/QtCore (0x1fef79aa8). One of the two will be used. Which one is undefined.
GKS: dlopen(.julia/artifacts/04878bfb5e675dcc3270d3beaa04445ac8cba280/lib/../lib/cairoplugin.so, 1): Library not loaded: @rpath/libtiff.5.dylib
  Referenced from: .julia/artifacts/04878bfb5e675dcc3270d3beaa04445ac8cba280/lib/cairoplugin.so
  Reason: Incompatible library version: cairoplugin.so requires version 13.0.0 or later, but libtiff.5.dylib provides version 11.0.0

Backends

GR

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot
plotly
plotlyjs
pgfplotsx
inspectdr

Versions

Plots.jl version: 1.15.2
Backend version (]st -m <backend(s)>): GR 57.5 (or 0.48 or some in between)
Output of versioninfo():

Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, westmere)
@henrikjaerleblad
Copy link

henrikjaerleblad commented Sep 13, 2021

I get the same bug using the GR backend for Plots.jl on Mac, but only when I try to save plot using png(). I used Plots.jl together with the Interact.jl package to create interactable plot widgets in my web browser, hence the 'Error handling websocket connection'. I am using Julia version 1.5.1.

bild

@henrikjaerleblad
Copy link

It seems to be working fine when using Julia and Plots.jl in the Mac OS terminal, until you want to save a plot with png().

However, when I try using Plots.jl in Atom, I get the error right away and cannot plot anything.

@henrikjaerleblad
Copy link

Alright, I solved the issue by re-installing Julia (and upgrading to 1.6.2) and all my packages. If you don't care why the problem happened, and just want a solution, you can follow this step-by-step solution:

  1. Remove Julia from Applications
  2. Remove the hidden .julia folder (will remove all packages, environments, dev, pre-compilations etc)
  3. Download the binary from https://julialang.org/downloads/ (the macOS 64-bit file, version 1.6.2)
  4. Re-install Julia normally (with the downloaded .dmg file etc)
  5. Change the PATH variable in your .bash_profile file (should be as simple as changing a '1.5' to '1.6')
  6. Start Julia in the MacOS terminal by typing 'julia'
  7. If you have been using the PyCall.jl package with your own Python executable, specify the ENV["PYTHON"] as described at https://github.com/JuliaPy/PyCall.jl already now
  8. Manually re-install all your Julia packages via 'Pkg.add()'
  9. You should now be good to go!

I also took the opportunity to switch from Atom to VSCode. If you have been using Atom's ftp-remote-edit package, you can find instructions on how to do the equivalent in VSCode here https://stackoverflow.com/questions/52085501/how-to-connect-vs-code-via-ftp-with-remote-workspace and here https://marketplace.visualstudio.com/items?itemName=liximomo.sftp .

Instructions on how to get started with Julia in VSCode

TL;DR One solution is to completely remove Julia and all Julia-related data and re-install everything.

@kellertuer
Copy link
Contributor Author

kellertuer commented Sep 13, 2021

Thanks for testing.
Indeed I was running on 1.6.0 and upgraded to 1.6.2 (hoping the ] up would recompile enough things.

I might try deleting the .Julia folder, but I am also both lazy (to set the things up again) and interested in the reason this happens and how one can usually resolve this.

Edit: I today took the short time to delete my .julia folder (but not uninstalling and reinstalling it). That alone did not help.

@t-bltg t-bltg added the GR label Sep 14, 2021
@kellertuer
Copy link
Contributor Author

This seems to be the same as #3416, and I could solve it by following the idea there, i.e. installing GR@0.55.0, though I am not sure which of the packages has to be updated in what way to resolve this.

musoke added a commit to musoke/UltraDark.jl that referenced this issue Sep 16, 2021
Julia 1.5 on MacOS is giving errors related to GR:

```
GKS: dlopen(/Users/runner/.julia/artifacts/8ad1378af931092f83916905440a69d0af818452/lib/../lib/cairoplugin.so, 1): Library not loaded: @rpath/libtiff.5.dylib
  Referenced from: /Users/runner/.julia/artifacts/8ad1378af931092f83916905440a69d0af818452/lib/cairoplugin.so
  Reason: Incompatible library version: cairoplugin.so requires version 13.0.0 or later, but libtiff.5.dylib provides version 11.0.0
soliton: Error During Test at /Users/runner/.julia/packages/SafeTestsets/A83XK/src/SafeTestsets.jl:25
  Got exception outside of a @test
```

These are only errors in generating plots in the example notebooks, so
don't really matter to the functionality of UltraDark.  However, I don't
actually need to support julia 1.5, so don't run these tests.

Related: JuliaPlots/Plots.jl#3800
musoke added a commit to musoke/UltraDark.jl that referenced this issue Sep 16, 2021
Julia 1.5 on MacOS is giving errors related to GR:

```
GKS: dlopen(/Users/runner/.julia/artifacts/8ad1378af931092f83916905440a69d0af818452/lib/../lib/cairoplugin.so, 1): Library not loaded: @rpath/libtiff.5.dylib
  Referenced from: /Users/runner/.julia/artifacts/8ad1378af931092f83916905440a69d0af818452/lib/cairoplugin.so
  Reason: Incompatible library version: cairoplugin.so requires version 13.0.0 or later, but libtiff.5.dylib provides version 11.0.0
soliton: Error During Test at /Users/runner/.julia/packages/SafeTestsets/A83XK/src/SafeTestsets.jl:25
  Got exception outside of a @test
```

These are only errors in generating plots in the example notebooks, so
don't really matter to the functionality of UltraDark.  However, I don't
actually need to support julia 1.5, so don't run these tests.

Related: JuliaPlots/Plots.jl#3800
musoke added a commit to musoke/UltraDark.jl that referenced this issue Sep 16, 2021
Julia 1.5 on MacOS is giving errors related to GR:

```
GKS: dlopen(/Users/runner/.julia/artifacts/8ad1378af931092f83916905440a69d0af818452/lib/../lib/cairoplugin.so, 1): Library not loaded: @rpath/libtiff.5.dylib
  Referenced from: /Users/runner/.julia/artifacts/8ad1378af931092f83916905440a69d0af818452/lib/cairoplugin.so
  Reason: Incompatible library version: cairoplugin.so requires version 13.0.0 or later, but libtiff.5.dylib provides version 11.0.0
soliton: Error During Test at /Users/runner/.julia/packages/SafeTestsets/A83XK/src/SafeTestsets.jl:25
  Got exception outside of a @test
```

These are only errors in generating plots in the example notebooks, so
don't really matter to the functionality of UltraDark.  However, I don't
actually need to support julia 1.5, so don't run these tests.

Related: JuliaPlots/Plots.jl#3800
@t-bltg t-bltg closed this as completed Nov 27, 2022
@t-bltg t-bltg added the upstream julia or dependencies label Nov 27, 2022
@brandonlivio
Copy link

I am facing a similar problem now: I can plot but i cannot save plots with savefig. If I run the following
using Plots plot(1:10) savefig("test.png")

I get

GKS: dlopen(/Users/brandonlivio/.julia/artifacts/4cab0d575711b60d292e4bd3088c55d27752a8ea/lib/cairoplugin.so, 1): Library not loaded: @rpath/libcairo.2.dylib Referenced from: /Users/brandonlivio/.julia/artifacts/4cab0d575711b60d292e4bd3088c55d27752a8ea/lib/cairoplugin.so Reason: Incompatible library version: cairoplugin.so requires version 11603.0.0 or later, but libcairo.2.dylib provides version 2.0.0 "/Users/brandonlivio/test.png"

I have tried everything, even completeley reinstalled julia, added only Plots and the problem persists. I am running on Mac 11.7.10 and using Julia 1.10.5 (the latest stable release)

@t-bltg
Copy link
Member

t-bltg commented Oct 8, 2024

Can you try using plain GR commands (https://github.com/jheinen/GR.jl) and report an upstream bug if it is applicable ?

@brandonlivio
Copy link

brandonlivio commented Oct 14, 2024

I get the same error if I run the following code

using GR
histogram(randn(1000))
savefig("test.png")

@t-bltg
Copy link
Member

t-bltg commented Oct 14, 2024

Please open an issue and report the bug in https://github.com/jheinen/GR.jl, as there is nothing we can do about it here in Plots.

@brandonlivio
Copy link

Makes sense, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug GR upstream julia or dependencies
Projects
None yet
Development

No branches or pull requests

4 participants