You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From within a script the loading of include("./FinEtools.jl") fails:
julia> include("runsimadapt.jl")
pwd() = c:\Users\PetrKrysl\devel\FinEtools\src
ERROR: LoadError: could not open file c:\Users\PetrKrysl\devel\CoNoGMOR\investigations\square_plate_hva\FinEtools.jl
Apparently the file is being sought in the wrong folder (even though pwd says we are in the correct folder containing the file to be loaded).
The text was updated successfully, but these errors were encountered:
include works relative to the directory in which the current source file resides or the current working director if you're in the REPL. This allows sets of files that are "glued together" by relative include calls to be position-independent in your file system. So the include("FinETools.jl") call looks for c:\Users\PetrKrysl\devel\FinEtools\src\FinETools.jl in the REPL but looks for c:\Users\PetrKrysl\devel\CoNoGMOR\investigations\square_plate_hva\FinEtools.jl when it occurs inside of c:\Users\PetrKrysl\devel\CoNoGMOR\investigations\square_plate_hva\runsimadapt.jl. The bottom line is that using cd to change working directories in order to load relative code in scripts won't work (and is probably a bad idea anyway). If you really want to do it anyway, you'll have to explicitly call pwd or abspath when constructing a path to pass to include like so: include(abspath("FinETools.jl")).
The following works in the REPL, but not when the same functions are called from within a script:
From within a script the loading of
include("./FinEtools.jl")
fails:Apparently the file is being sought in the wrong folder (even though
pwd
says we are in the correct folder containing the file to be loaded).The text was updated successfully, but these errors were encountered: