Cannot use PyPlot on apple m1 due to PyQt5 installation problem

On apple m1, with julia 1.7, trying to use PyPlot fails because it is not able to install PyQt5

julia> using PyPlot
[ Info: Installing pyqt package to avoid buggy tkagg backend.
[ Info: Installing PyQt5 via the Conda pyqt package...
[ Info: Running `conda install -y pyqt` in root environment
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - pyqt

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-arm64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Searching has not yielded any solutions. This post Plotting fails on a fresh MacOS install - #2 by Alexandre_Champagne also did not help

1 Like

Yes I have the exact same problem. This issue was recently posted to the PyPlots GitHub page here:

Let’s hope for a quick fix because this totally shuts down my science development. I use PyPlots intensely!

I was able to get pyqt working with PyPlots by installing pyqt via a special Conda channel:

Conda.add(“pyqt”, channel=“andfoy”)

Also it seems that conda channel robostack-experimental has pyqt for arm64… just wish I knew which channel was better or that I trusted these rare “one off” channels.

Why hasn’t Conda-forge added arm64 version of pyqt?

1 Like

They had one recently, because it works fine on my M1 mac with no tricks. Maybe run using Conda; Conda.update()?

You can always try a different backend by setting the MPLBACKEND environment variable.

1 Like

Updating conda still does not install pyqt for me. Changing backend to tkagg works but gives warning everytime

┌ Warning: PyPlot is using tkagg backend, which is known to cause crashes on MacOS (#410); use the MPLBACKEND environment variable to request a different backend.
â”” @ PyPlot ~/.julia/packages/PyPlot/XaELc/src/init.jl:198
┌ Warning: `vendor()` is deprecated, use `BLAS.get_config()` and inspect the output instead
│   caller = npyinitialize() at numpy.jl:67
â”” @ PyCall ~/.julia/packages/PyCall/L0fLP/src/numpy.jl:67

Is there a way to suppress these ?

There is an open pull request: https://github.com/JuliaPy/PyCall.jl/pull/950

1 Like