Precompile error with DataFrames

I started this post because of an issue with CSV, but now I have a precompile error with DataFrames. It installs ok, but when I try using it, I get

\u250c Info: Precompiling DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0]
\u2514 @ Base loading.jl:1342
ERROR: LoadError: LoadError: UndefVarError: tostr_sizehint not defined
Stacktrace:
  [1] getproperty(x::Module, f::Symbol)
    @ Base ./Base.jl:26
  [2] top-level scope
    @ ~/.julia/packages/CategoricalArrays/qcwgl/src/deprecated.jl:101
  [3] include(mod::Module, _path::String)
    @ Base ./Base.jl:386
  [4] include(x::String)
    @ CategoricalArrays ~/.julia/packages/CategoricalArrays/qcwgl/src/CategoricalArrays.jl:1
  [5] top-level scope
    @ ~/.julia/packages/CategoricalArrays/qcwgl/src/CategoricalArrays.jl:39
  [6] include
    @ ./Base.jl:386 [inlined]
  [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1235
  [8] top-level scope
    @ none:1
  [9] eval
    @ ./boot.jl:360 [inlined]
 [10] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [11] top-level scope
    @ none:1
in expression starting at /home/davide/.julia/packages/CategoricalArrays/qcwgl/src/deprecated.jl:101
in expression starting at /home/davide/.julia/packages/CategoricalArrays/qcwgl/src/CategoricalArrays.jl:1
ERROR: LoadError: Failed to precompile CategoricalArrays [324d7699-5711-5eae-9e2f-1d82baa6b597] to /home/davide/.julia/compiled/v1.6/CategoricalArrays/jl_bVsqXg.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{Base.PipeEndpoint}, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:923
  [7] include
    @ ./Base.jl:386 [inlined]
  [8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1235
  [9] top-level scope
    @ none:1
 [10] eval
    @ ./boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at /home/davide/.julia/packages/DataFrames/yH0f6/src/DataFrames.jl:1

Failed to precompile DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0] to /home/davide/.julia/compiled/v1.6/DataFrames/jl_oSVuVE.

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IJulia.IJuliaStdio{Base.PipeEndpoint}, internal_stdout::IJulia.IJuliaStdio{Base.PipeEndpoint}, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1385
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1329
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1043
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:936
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:923
 [7] eval
   @ ./boot.jl:360 [inlined]
 [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1116

What a mess! CSV and DataFrames are so basic!!

Thanks for any hints. From reading, I think this is because I had to downgrade something to get CSV running (!)

Do both work if you try in a new project?

Thanks for the suggestion, but I get the same error

I guess I have to go back to 1.5

What does Pkg.status() report? Does it persist through Julia restarts? Or if in a Jupyter notebook — does it persist through kernel restarts?

This appears to be due to a package downgrade. A new project should indeed fix it.

CSV.jl was recently updated; the new version works with the new Parsers version. I guess you could revert now pinning the package Parsers (] free Parsers).

On my machine everything works with

using Pkg
Pkg.activate(temp = true)
Pkg.add(["CSV", "DataFrames", "IJulia"])
using IJulia, CSV, DataFrames

Hi. That’s great, thanks (and thanks for whoever fixed CSV!)
What is the easiest way to uninstall everything from an environment (e.g. the default one) and start over?

Don’t know what the easiest is, but I guess you could open the Project.toml file and remove all [deps] (or delete the Project.toml and Manifest.toml entirely) or you could run Pkg.rm(collect(keys(Pkg.installed()))).