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

Broken Pipe: Plotting with Julia Version 1.7.1 (2021-12-22) #4024

Closed
Wintereinbruch opened this issue Jan 4, 2022 · 14 comments
Closed

Broken Pipe: Plotting with Julia Version 1.7.1 (2021-12-22) #4024

Wintereinbruch opened this issue Jan 4, 2022 · 14 comments

Comments

@Wintereinbruch
Copy link

Before I give up on Julia within the first hour.

Has this been solved: #2451

I installed Julia and experience the same problem (M1 MacBook Pro).

Not a very good start if I am honest:

julia> using Plots

julia> x = 1:10; y = rand(10);

julia> plot(x, y)

julia> plot(x, y)

julia> plot(x, y)
send: Broken pipe
send: Broken pipe
send: Broken pipe

julia> plot(x, y)

julia> plot(x, y)

julia> plot(x, y)
send: Broken pipe
send: Broken pipe
send: Broken pipe

julia> plot(x, y)

julia> plot(x, y)

julia> plot(x, y)
send: Broken pipe
send: Broken pipe
send: Broken pipe

julia> plot(x, y)

julia> plot(x, y)

...

@Wintereinbruch
Copy link
Author

Also matplotlib is not working:

Plots.PyPlotBackend()

julia> plot(rand(4,4))
┌ 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
sys:1: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

julia> plot(rand(4,4))
sys:1: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

  1. And nothing from here works: No working GUI backend found for matplotlib JuliaPy/PyPlot.jl#418

  2. Then there is this discussion: https://discourse.julialang.org/t/non-gui-backend-so-cannot-show-the-figure/28445

But conda cannot install pyqt5: conda install -c dsdale24 pyqt5

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

Is plotting with Julia possible at all?

@Wintereinbruch
Copy link
Author

Conda is able to install pyqt5 for Python > 3:

conda install -c conda-forge pyqt

But still Julia doesn't do anything:

julia> using PyPlot

julia> pygui(true)
true

julia> plot(rand(4,4))
4-element Vector{PyCall.PyObject}:
PyObject <matplotlib.lines.Line2D object at 0x13f7bf430>
PyObject <matplotlib.lines.Line2D object at 0x13f7bf460>
PyObject <matplotlib.lines.Line2D object at 0x13f7bf580>
PyObject <matplotlib.lines.Line2D object at 0x13f7bf6a0>

julia> plt.show()
sys:1: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

@Wintereinbruch
Copy link
Author

To be fair here:

saving a figure would work (https://stackoverflow.com/questions/56656777/userwarning-matplotlib-is-currently-using-agg-which-is-a-non-gui-backend-so):

julia> plt.savefig("./name.png")

@Wintereinbruch
Copy link
Author

I give up.

Plotting doesn't work. A total mess.

Good luck getting the Python data science community to switch over to Julia:

julia> ENV["PYTHON"]="/opt/anaconda3/bin/python"
"/opt/anaconda3/bin/python"

julia> using Pkg

julia> Pkg.add("PyCall")
Updating registry at ~/.julia/registries/General.toml
Resolving package versions...
Updating ~/.julia/environments/v1.7/Project.toml
[438e738f] + PyCall v1.93.0
No Changes to ~/.julia/environments/v1.7/Manifest.toml
Precompiling project...
46 dependencies successfully precompiled in 27 seconds (84 already precompiled)

julia> Pkg.add("PyPlot")
Resolving package versions...
No Changes to ~/.julia/environments/v1.7/Project.toml
No Changes to ~/.julia/environments/v1.7/Manifest.toml

julia> using PyPlot
[ 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:

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.

ERROR: InitError: failed process: ... "DISPLAY=/private/tmp/com.apple.launchd.DXxZWQyDrJ/org.xquartz:0", ... "OPENBLAS_MAIN_FREE=1", "PYTHONIOENCODING=UTF-8"]), ProcessExited(1)) [1]

Stacktrace:
[1] pipeline_error
@ ./process.jl:531 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:446
[3] run
@ ./process.jl:444 [inlined]
[4] runconda(args::Cmd, env::String)
@ Conda ~/.julia/packages/Conda/1403Y/src/Conda.jl:130
[5] add(pkg::String, env::String; channel::String)
@ Conda ~/.julia/packages/Conda/1403Y/src/Conda.jl:223
[6] add (repeats 2 times)
@ ~/.julia/packages/Conda/1403Y/src/Conda.jl:222 [inlined]
[7] pyimport_conda(modulename::String, condapkg::String, channel::String)
@ PyCall ~/.julia/packages/PyCall/L0fLP/src/PyCall.jl:713
[8] pyimport_conda
@ ~/.julia/packages/PyCall/L0fLP/src/PyCall.jl:707 [inlined]
[9] find_backend(matplotlib::PyCall.PyObject)
@ PyPlot ~/.julia/packages/PyPlot/XaELc/src/init.jl:91
[10] init()
@ PyPlot ~/.julia/packages/PyPlot/XaELc/src/init.jl:193
[11] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base ./loading.jl:768
[12] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
@ Base ./loading.jl:854
[13] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1097
[14] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:1013
[15] require(into::Module, mod::Symbol)
@ Base ./loading.jl:997
during initialization of module PyPlot

caused by: PyError (PyImport_ImportModule

The Python package PyQt5 could not be imported by pyimport. Usually this means
that you did not install PyQt5 in the Python version being used by PyCall.

PyCall is currently configured to use the Julia-specific Python distribution
installed by the Conda.jl package. To install the PyQt5 module, you can
use pyimport_conda("PyQt5", PKG), where PKG is the Anaconda
package that contains the module PyQt5, or alternatively you can use the
Conda package directly (via using Conda followed by Conda.add etcetera).

Alternatively, if you want to use a different Python distribution on your
system, such as a system-wide Python (as opposed to the Julia-specific Python),
you can re-configure PyCall with that Python. As explained in the PyCall
documentation, set ENV["PYTHON"] to the path/name of the python executable
you want to use, run Pkg.build("PyCall"), and re-launch Julia.

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'PyQt5'")

Stacktrace:
[1] pyimport(name::String)
@ PyCall ~/.julia/packages/PyCall/L0fLP/src/PyCall.jl:550
[2] pyimport_conda(modulename::String, condapkg::String, channel::String)
@ PyCall ~/.julia/packages/PyCall/L0fLP/src/PyCall.jl:708
[3] pyimport_conda
@ ~/.julia/packages/PyCall/L0fLP/src/PyCall.jl:707 [inlined]
[4] find_backend(matplotlib::PyCall.PyObject)
@ PyPlot ~/.julia/packages/PyPlot/XaELc/src/init.jl:91
[5] init()
@ PyPlot ~/.julia/packages/PyPlot/XaELc/src/init.jl:193
[6] _include_from_serialized(path::String, depmods::Vector{Any})
@ Base ./loading.jl:768
[7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
@ Base ./loading.jl:854
[8] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1097
[9] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:1013
[10] require(into::Module, mod::Symbol)
@ Base ./loading.jl:997

julia> pyimport_conda("PyQt5", PKG)
ERROR: UndefVarError: pyimport_conda not defined
Stacktrace:
[1] top-level scope
@ REPL[7]:1

julia> using Conda
│ Package Conda not found, but a package named Conda is available from a registry.
│ Install package?
│ (@v1.7) pkg> add Conda
└ (y/n) [y]: y
Resolving package versions...
Updating ~/.julia/environments/v1.7/Project.toml
[8f4d0f93] + Conda v1.6.0
No Changes to ~/.julia/environments/v1.7/Manifest.toml

julia> Conda.add("PyQt5")
[ Info: Running conda install -y PyQt5 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:

  • pyqt5

Current channels:

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.

ERROR: failed process: ... "OPENBLAS_MAIN_FREE=1", "PYTHONIOENCODING=UTF-8"]), ProcessExited(1)) [1]

Stacktrace:
[1] pipeline_error
@ ./process.jl:531 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:446
[3] run
@ ./process.jl:444 [inlined]
[4] runconda(args::Cmd, env::String)
@ Conda ~/.julia/packages/Conda/1403Y/src/Conda.jl:130
[5] add(pkg::String, env::String; channel::String)
@ Conda ~/.julia/packages/Conda/1403Y/src/Conda.jl:223
[6] add (repeats 2 times)
@ ~/.julia/packages/Conda/1403Y/src/Conda.jl:222 [inlined]
[7] top-level scope
@ REPL[9]:1

@isentropic
Copy link
Member

I mean you can't sh*t on people who've maintaining this thanklessly and expect prompt 1to1 person helping you while running tier 3 Julia support platform (m1 Mac).

Your current attitude wouldn't solve your problem. I say if you don't like it don't use it.

@Wintereinbruch
Copy link
Author

I deleted my response as this should go on private email communication and will lead to nothing.

It would really help if there is a clear communication that (Julia) plotting is obviously not supported on the OSX platform.

@mkborregaard
Copy link
Member

I am on a Mac (currently M1) and have used Plots essentially flawlessly for years.
@Wintereinbruch which julia version are you using? You should probably still be using the "Intel or Rosetta" binary from the julia download page, as the ARM architecture is not yet supported natively on many of the binary dependencies used by e.g. conda.

@Wintereinbruch
Copy link
Author

Wintereinbruch commented Jan 6, 2022 via email

@mkborregaard
Copy link
Member

Yeah, try going here https://julialang.org/downloads/#current_stable_release and downloading the binary called "macOS x86 (Intel or Rosetta)".
Adapting to new processor architectures are always a massive challenge for open-source community projects - julia will get there (JuliaPackaging/Yggdrasil#2763) but it takes time.

@isentropic isentropic reopened this Jan 6, 2022
@isentropic
Copy link
Member

I suggest you to just use a different backend like plotly or even unicode:
https://docs.juliaplots.org/latest/backends/

@Wintereinbruch
Copy link
Author

Wintereinbruch commented Jan 7, 2022 via email

@Wintereinbruch
Copy link
Author

Wintereinbruch commented Jan 7, 2022 via email

@Wintereinbruch
Copy link
Author

Wintereinbruch commented Jan 7, 2022 via email

@Wintereinbruch
Copy link
Author

Wintereinbruch commented Jan 7, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants