gc 出错 如何处理

(@v1.4) pkg> gc
ERROR: Pkg.TOML.ParserError(6925038, 6925039, “expected =, but found \n”)
Stacktrace:
[1] parse(::Base.GenericIOBuffer{Array{UInt8,1}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\ext\TOML\src\TOML.jl:37
[2] parse at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\ext\TOML\src\TOML.jl:44 [inlined]
[3] (::Pkg.API.var"#collect_usage!#83")(::Dict{String,Dates.DateTime}, ::String) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:353
[4] gc(::Pkg.Types.Context; collect_delay::Dates.Day, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:372
[5] gc at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\API.jl:330 [inlined] (repeats 2 times)
[6] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:400
[7] do_cmd(::REPL.LineEditREPL, ::String; do_rethrow::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:381
[8] do_cmd at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:376 [inlined]
[9] (::Pkg.REPLMode.var"#24#27"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\Pkg\src\REPLMode\REPLMode.jl:542
[10] #invokelatest#1 at .\essentials.jl:712 [inlined]
[11] invokelatest at .\essentials.jl:711 [inlined]
[12] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\LineEdit.jl:2354
[13] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:1055
[14] run_repl(::REPL.AbstractREPL, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.4\REPL\src\REPL.jl:206
[15] (::Base.var"#764#766"{Bool,Bool,Bool,Bool})(::Module) at .\client.jl:383
[16] #invokelatest#1 at .\essentials.jl:712 [inlined]
[17] invokelatest at .\essentials.jl:711 [inlined]
[18] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at .\client.jl:367
[19] exec_options(::Base.JLOptions) at .\client.jl:305
[20] _start() at .\client.jl:484

去看看
C:\Users\你的用户名\.julia\environments\v1.4\Manifest.toml
是不是少了个 =

应该不是Manifest.toml的问题,删除Manifest.toml重建以后还这样

It looks like there is an error while parsing the .julia/logs/manifest_usage.toml (presumably at line 238526 or is that a byte offset?)

删除 .julia/logs/manifest_usage.toml + 重启 julia 试试

using Pkg

using Pkg.TOML

function parse(dir)

    contents=readdir(dir)

    for c in contents

        path=pwd()

        path=joinpath(path,c)

        if isdir(path)

            println("Enter $c")

            path=joinpath(pwd(),c)

            cd(path)

            parse(path)

        else

            if splitext(c)[2] == ".toml"

                    path=pwd()

                    print("parsing $path $c\n")

                    TOML.parsefile(c)

            end

        end

    end

    cd("..")

end

dir="c:/users/administrator/.julia"

cd(dir)

parse(dir)

写了段程序,挨个parse *.toml,找到的也是.julia/logs/manifest_usage.toml这个文件出错

1 个赞