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] Activating pyplot() backend throws and warning #4591

Closed
shayandavoodii opened this issue Dec 8, 2022 · 7 comments · Fixed by #4592
Closed

[BUG] Activating pyplot() backend throws and warning #4591

shayandavoodii opened this issue Dec 8, 2022 · 7 comments · Fixed by #4592

Comments

@shayandavoodii
Copy link

Details

Activating pyplot() backend throws and warning

Backends

This bug occurs on ( insert x below )

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

Versions

Plots.jl version: 1.37.1
Backend version (]st -m <backend(s)>):

(@v1.8) pkg> st -m pyplot
No Matches in `C:\Users\Shayan\.julia\environments\v1.8\Manifest.toml`

Output of versioninfo():

julia> versioninfo()
Julia Version 1.8.3
Commit 0434deb161 (2022-11-14 20:14 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, haswell)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_PYTHONCALL_EXE = C:\Users\Shayan\AppData\Local\Programs\Python\Python310\python.exe

The warning is as follows:

julia> pyplot()
┌ Warning: Error requiring `PyPlot` from `Plots`
│   exception =
│    ArgumentError: not a path: `C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends\pyplot.jl`
│    Stacktrace:
│      [1] RelocatableFolders.Path(mod::Module, dir::String, path::String,
 ignore::Nothing)
│        @ RelocatableFolders C:\Users\Shayan\.julia\packages\RelocatableFolders\64bhJ\src\RelocatableFolders.jl:55
│      [2] _path(sym::Function)
│        @ Plots C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends.jl:59
│      [3] top-level scope
│        @ C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends.jl:95
│      [4] eval
│        @ .\boot.jl:368 [inlined]
│      [5] eval
│        @ C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\Plots.jl:1 [inlined]
│      [6] (::Plots.var"#638#641")()
│        @ Plots C:\Users\Shayan\.julia\packages\Requires\Z8rfN\src\require.jl:101
│      [7] macro expansion
│        @ timing.jl:382 [inlined]
│      [8] err(f::Any, listener::Module, modname::String, file::String, line::Any)
│        @ Requires C:\Users\Shayan\.julia\packages\Requires\Z8rfN\src\require.jl:47
│      [9] (::Plots.var"#637#640")()
│        @ Plots C:\Users\Shayan\.julia\packages\Requires\Z8rfN\src\require.jl:100
│     [10] withpath(f::Any, path::String)
│        @ Requires C:\Users\Shayan\.julia\packages\Requires\Z8rfN\src\require.jl:37
│     [11] (::Plots.var"#636#639")()
│        @ Plots C:\Users\Shayan\.julia\packages\Requires\Z8rfN\src\require.jl:99
│     [12] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [13] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [14] foreach(f::typeof(Base.invokelatest), itr::Vector{Function})
│        @ Base .\abstractarray.jl:2774
│     [15] loadpkg(pkg::Base.PkgId)
│        @ Requires C:\Users\Shayan\.julia\packages\Requires\Z8rfN\src\require.jl:27
│     [16] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [17] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [18] run_package_callbacks(modkey::Base.PkgId)
│        @ Base .\loading.jl:869
│     [19] _require_prelocked(uuidkey::Base.PkgId)
│        @ Base .\loading.jl:1206
│     [20] macro expansion
│        @ .\loading.jl:1180 [inlined]
│     [21] macro expansion
│        @ .\lock.jl:223 [inlined]
│     [22] require(into::Module, mod::Symbol)
│        @ Base .\loading.jl:1144
│     [23] top-level scope
│        @ C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends.jl:810
│     [24] eval
│        @ .\boot.jl:368 [inlined]
│     [25] _initialize_backend(pkg::Plots.PyPlotBackend)
│        @ Plots C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends.jl:809
│     [26] backend(pkg::Plots.PyPlotBackend)
│        @ Plots C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends.jl:260
│     [27] #pyplot#315
│        @ C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends.jl:81 [inlined]
│     [28] pyplot()
│        @ Plots C:\Users\Shayan\.julia\packages\Plots\UTR4H\src\backends.jl:81
│     [29] top-level scope
│        @ REPL[2]:1
│     [30] eval
│        @ .\boot.jl:368 [inlined]
│     [31] eval_user_input(ast::Any, backend::REPL.REPLBackend)
│        @ REPL C:\Users\Shayan\.julia\juliaup\julia-1.8.3+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:151
│     [32] repl_backend_loop(backend::REPL.REPLBackend)
│        @ REPL C:\Users\Shayan\.julia\juliaup\julia-1.8.3+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:247
│     [33] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
│        @ REPL C:\Users\Shayan\.julia\juliaup\julia-1.8.3+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:232
│     [34] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
│        @ REPL C:\Users\Shayan\.julia\juliaup\julia-1.8.3+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:369
│     [35] run_repl(repl::REPL.AbstractREPL, consumer::Any)
│        @ REPL C:\Users\Shayan\.julia\juliaup\julia-1.8.3+0.x64\share\julia\stdlib\v1.8\REPL\src\REPL.jl:355
│     [36] (::Base.var"#967#969"{Bool, Bool, Bool})(REPL::Module)
│        @ Base .\client.jl:419
│     [37] #invokelatest#2
│        @ .\essentials.jl:729 [inlined]
│     [38] invokelatest
│        @ .\essentials.jl:726 [inlined]
│     [39] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
│        @ Base .\client.jl:404
│     [40] exec_options(opts::Base.JLOptions)
│        @ Base .\client.jl:318
│     [41] _start()
│        @ Base .\client.jl:522
└ @ Requires C:\Users\Shayan\.julia\packages\Requires\Z8rfN\src\require.jl:51
Plots.PyPlotBackend()
@t-bltg
Copy link
Member

t-bltg commented Dec 8, 2022

This shouldn't happen, I'll have a look asap.

Did you try pythonplot ? It's a drop in replacement for pyplot.

@t-bltg t-bltg added the PyPlot label Dec 8, 2022
@shayandavoodii
Copy link
Author

shayandavoodii commented Dec 8, 2022

Did you try pythonplot?

Is it a package?

@t-bltg
Copy link
Member

t-bltg commented Dec 8, 2022

pkg> add PythonPlot
julia> using Plots
julia> pythonplot()

See also the announcement at https://discourse.julialang.org/t/ann-plots-1-37-rfc-plots-2-0/91270.
And also the docs.

@shayandavoodii
Copy link
Author

pkg> add PythonPlot
julia> using Plots
julia> pythonplot()

See also the announcement at https://discourse.julialang.org/t/ann-plots-1-37-rfc-plots-2-0/91270. And also the docs.

Thanks. It worked.

@t-bltg t-bltg mentioned this issue Dec 8, 2022
@t-bltg
Copy link
Member

t-bltg commented Dec 8, 2022

Glad it worked. In the mean time, the pyplot bug will be fixed by #4592.

I will merge and tag a new Plots release asap.
Sorry for the inconvenience.

@shayandavoodii
Copy link
Author

Glad it worked. In the mean time, the pyplot bug will be fixed by #4592.

I will merge and tag a new Plots release asap. Sorry for the inconvenience.

Thanks a lot! There isn't anything to be sorry about! Well done.

@t-bltg
Copy link
Member

t-bltg commented Dec 8, 2022

I broke it, I fix it ;)

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

Successfully merging a pull request may close this issue.

2 participants