@edit does not work on my system

I want to try the macro @edit but I got

julia> @edit 3+5
ERROR: could not find source file for function
Stacktrace:
 [1] edit(::Nothing, ::Int32) at /build/julia/src/julia-1.5.3/usr/share/julia/stdlib/v1.5/InteractiveUtils/src/editless.jl:224
 [2] edit(::Function, ::Any) at /build/julia/src/julia-1.5.3/usr/share/julia/stdlib/v1.5/InteractiveUtils/src/editless.jl:223
 [3] top-level scope at REPL[167]:1
 [4] run_repl(::REPL.AbstractREPL, ::Any) at /build/julia/src/julia-1.5.3/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:288

I know there was a bug but has been fixed https://github.com/JuliaLang/julia/pull/32763
Do I need some setup to use this macro?
My system is Manjaro Linux.

How did you download julia? If you didn’t download from the official binaries that could be the cause of the problem.

I have a similar issue on Windows 10.

julia> @edit 3+5
ERROR: SystemError: edit: No error
Stacktrace:
 [1] systemerror(::Symbol, ::Int32; extrainfo::Nothing) at .\error.jl:168
 [2] #systemerror#48 at .\error.jl:167 [inlined]
 [3] systemerror at .\error.jl:167 [inlined]
 [4] (::InteractiveUtils.var"#14#24")(::Cmd, ::String, ::Int32) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\InteractiveUtils\src\editless.jl:151
 [5] edit(::String, ::Int32) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\InteractiveUtils\src\editless.jl:202
 [6] edit(::Function, ::Any) at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\InteractiveUtils\src\editless.jl:223
 [7] top-level scope at REPL[2]:1

I installed the official binary v1.5.3.

Look at this issue: https://github.com/JuliaLang/julia/issues/40036

Another user reports the problem as specific to the Manjaro package. i think it is usually better to use the official binaries. It is not rare to see problems in the packages shipped by the distributions themselves.

2 Likes

Thank you. I didn’t know the package shipped by the distribution has that problem. I will try the official binary.

1 Like