-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Comments
Also matplotlib is not working: Plots.PyPlotBackend() julia> plot(rand(4,4)) julia> plot(rand(4,4))
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. Is plotting with Julia possible at all? |
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) julia> plot(rand(4,4)) julia> plt.show() |
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") |
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" julia> using Pkg julia> Pkg.add("PyCall") julia> Pkg.add("PyPlot") julia> using PyPlot PackagesNotFoundError: The following packages are not available from current channels:
Current channels: To search for alternate channels that may provide the conda package you're
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: caused by: PyError (PyImport_ImportModule The Python package PyQt5 could not be imported by pyimport. Usually this means PyCall is currently configured to use the Julia-specific Python distribution Alternatively, if you want to use a different Python distribution on your ) <class 'ModuleNotFoundError'> Stacktrace: julia> pyimport_conda("PyQt5", PKG) julia> using Conda julia> Conda.add("PyQt5") PackagesNotFoundError: The following packages are not available from current channels:
Current channels: To search for alternate channels that may provide the conda package you're
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: |
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. |
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. |
I am on a Mac (currently M1) and have used Plots essentially flawlessly for years. |
Hi
I admit I haven’t fully tested Julia but base Julia seems to be working. Also the ’time to the first plot’ wasn’t too bad. Nothing like what is written on the net. My main development machine is not my Macbook (it is Linux at work) but I often test things on my Macbook because our Linux work environment is heavily controlled (I cannot easily install new software).
I downloaded Julia 1.7.1 (2021-12-22) for Apple M1 and when I start Julia I see the following:
Last login: Wed Jan 5 20:54:04 on ttys007
exec '/private/var/folders/w9/gklj07416x9g3wmt5_4f4p840000gn/T/AppTranslocation/71FE7ED0-BAF0-4F7D-9C0F-EFFF1420ACEE/d/Julia-1.7.app/Contents/Resources/julia/bin/julia'
(base) ~ % exec '/private/var/folders/w9/gklj07416x9g3wmt5_4f4p840000gn/T/AppTranslocation/71FE7ED0-BAF0-4F7D-9C0F-EFFF1420ACEE/d/Julia-1.7.app/Contents/Resources/julia/bin/julia'
The Python is:
Python 3.8.8 (default, Apr 13 2021, 12:59:45)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
And my system:
MacBook Pro 13”, M1 processor, macOS Big Sur 11.6.1
Actually I am not planning to use Julia in the REPL. I will use Julia from the command line and write code in Emacs. Most of the plots will be saved to files. I never use Python or Jupiter interactively (sometimes for testing short numpy constructs and very rarely for making live plots). But even using Python from the command line (e.g. python foo.py) it often helps during the development process to see plot output on the screen.
… On 6 Jan 2022, at 09:14, Michael Krabbe Borregaard ***@***.***> wrote:
I am on a Mac (currently M1) and have used Plots essentially flawlessly for years.
@Wintereinbruch <https://github.com/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.
—
Reply to this email directly, view it on GitHub <#4024 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AELAAXJXUQVEYZ3TJS5IX3LUUVMOJANCNFSM5LIRQ25Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.
|
Yeah, try going here https://julialang.org/downloads/#current_stable_release and downloading the binary called "macOS x86 (Intel or Rosetta)". |
I suggest you to just use a different backend like plotly or even unicode: |
Hi: I will report back here how things are going on OSX. Will try it out over the coming weekend.
… On 6 Jan 2022, at 09:45, Michael Krabbe Borregaard ***@***.***> wrote:
Yeah, try going here https://julialang.org/downloads/#current_stable_release <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 <JuliaPackaging/Yggdrasil#2763>) but it takes time.
—
Reply to this email directly, view it on GitHub <#4024 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AELAAXMNBCYRYB34GXJT5GTUUVQERANCNFSM5LIRQ25Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.
|
This is for the Julia "macOS x86 (Intel or Rosetta)" 64-bit version.
(See at the end where I tested it on PyPlot and Plots).
I haven't tested it with the Julia M1 version because there is only one ~/.julia directory and they might mess up (as the old saying goes: never touch a working system).
My system:
1. MacBook Pro 13", M1, 2020, macOS BigSur 11.6.1
2. Python 3.8.8, [Clang 10.0.0 ], Anaconda, Inc. on darwin
3. Terminal Version 2.11 (440)
What I did:
1. Deleted my old Julia directory in my home directory: "rm -r ~/.julia"
2. Downloaded "macOS x86 (Intel or Rosetta)" from: https://julialang.org/downloads/
3. I then started Julia and my Terminal with Julia popped up
4. I found the following command here (JuliaPy/PyPlot.jl#219) and typed it off:
julia> ENV["PYTHON"]=""; Pkg.build("PyCall");using PyPlot
This as far as I understand will link from your local conda Python distribution to Julia.
(It could well be the case you have to add a few more packages but you then follow what Julia tells you on the Julia command line).
A few observations:
The following works without "broken pipes" error messages:
julia> using PyPlot
julia> dat = rand(10)
julia> plot(dat)
┌ 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
qt.qpa.drawing: Layer-backing can not be explicitly controlled on 10.14 when built against the 10.14 SDK
1-element Vector{PyCall.PyObject}:
PyObject <matplotlib.lines.Line2D object at 0x167e16d30>
julia> plot(dat)
julia> plot(dat)
Note: The above warning only appears the first time round.
Now, you have to close Julia and start it again for testing the following. It seems to me you cannot load two Plot versions at the same time (plotting wouldn’t work at all):
julia> using Plots
julia> data = rand(10)
julia> plot(data)
It will plot. But if you close the plotting window and plot again it will result in "broken pipe" error messages. One way of avoiding the 'broken pipe error message' would be using closeall() in front of the plot command:
julia> closeall(); plot(dat)
Also note: "using PyPlot" will result that the plot is send to the Matplotlib plotting window as fare as I can tell. The "using Plots" will plot in a "GKS QtTerm" output window (I have no idea what that is and where it comes from).
Next step will be trying to produce plot output to files by using Julia from the bash command line in script mode.
… On 6 Jan 2022, at 09:45, Michael Krabbe Borregaard ***@***.***> wrote:
Yeah, try going here https://julialang.org/downloads/#current_stable_release <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 <JuliaPackaging/Yggdrasil#2763>) but it takes time.
—
Reply to this email directly, view it on GitHub <#4024 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AELAAXMNBCYRYB34GXJT5GTUUVQERANCNFSM5LIRQ25Q>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.
|
Although it would still be important to understand what the following means:
┌ 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
qt.qpa.drawing: Layer-backing can not be explicitly controlled on 10.14 when built against the 10.14 SDK
1-element Vector{PyCall.PyObject}:
PyObject <matplotlib.lines.Line2D object at 0x167e7fd30>
… |
I post it here maybe someone with macOS/OS X woes finds it useful: plotting in Julia script mode.
The following would also work from the command line on my M1 Macbook (see my Macbook systems specifications a few posts above):
testplot.jl:
using PyCall
@pyimport matplotlib.pyplot as plt
@pyimport numpy as np
x = np.linspace(0, 2*np.pi, 1000)
y = np.sin(3*x + 4 * np.cos(2*x))
plt.plot(x, y, color="red", linewidth=2.0, linestyle="--")
plt.title("A sinusoidally modulated sinusoid")
plt.show()
#or use: plt.savefig(“./test.png”)
And then in bash or Terminal the command line:
julia testplot.jl
I haven’t played around with speeding it up. But it only takes 3 seconds from firing it off at the command line and until the plot appears on the screen. Not too bad actually. Again nowhere near as bad as it is claimed (time for the first plot to materialise) on the all knowing internet.
… |
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)
...
The text was updated successfully, but these errors were encountered: