Skip to content

FileIO not loading / requiring dependency AVSfldIO properly #353

Closed
@JeffFessler

Description

Attempting to read AVSfld format files is failing due (apparently) to FileIO not properly loading the required AVSfldIO package. I thought the magic of require in FileIO would take care of this automatically. I tried the suggested Pkg.instantiate() but that did not help. The only solution I have found is to explicitly add AVSfileIO and invoke it with using but I thought that FileIO was supposed to make that happen behind the scenes without user intervention. It makes me suspect that my original PR #333 for this format was somehow incomplete. Here is a MWE that writes some test data to a .fld file and then attempts to load it.

using FileIO
#using AVSfldIO # Must add this package and uncomment this line for code to work
buf = IOBuffer()
write(buf, "# AVS\n", "ndim=2\n", "dim1=3\n", "dim2=4\n",
    "nspace=2\n", "veclen=1\n", "data=float_le\n", "field=uniform\n",
    '\f', '\f', Float32.(1:12)) # test data
file = "tmp.fld"
open(file, "w") do io write(io, take!(buf)) end
load(file)

Error encountered while load File{DataFormat{:AVSfld}, String}("tmp.fld").

Fatal error:
ERROR: LoadError: ArgumentError: Package AVSfldIO [b6189060-daf9-4c28-845a-cc0984b81781] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
  [1] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1089
  [2] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
  [3] #34
    @ ~/.julia/packages/FileIO/FUXWu/src/loadsave.jl:203 [inlined]
  [4] lock(f::FileIO.var"#34#35"{Base.PkgId}, l::ReentrantLock)
    @ Base ./lock.jl:190
  [5] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Formatted; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/FUXWu/src/loadsave.jl:203

Originally AVSfldIO.jl was under my github site and then we moved it under JulioIO organization. Could that move have made it harder for FileIO to locate? I doubt it, but I am at a loss for why this is not working. Thanks!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions