I use Mathematica 11 and create a project containing two files: a package file named
MyPackage.m and the other named
run.m. The package file contains just normal functions not in special Mathematica package structure (see here), and the other contains code to get
MyPackage.m and use the functions.
(* Package.m *) myFun[x_String] := Print[x] ... (* run.m *) <<"Package.m" myFun["Hello,World"]
I put these two files into one directory and ensure that the
$path contains the directory path. But, when I run
wolframscript -file ./run.m -print all, it complains
$Failed. The question is: how to import another file when using
wolframscript? It seems cannot find the destination file even they are in the same directory.
I use Mathematica 11 and run
wolframscript in Ubuntu server where I have installed the latest Free CDF Player.
After installing the whole Mathematica at my Ubuntu server,
wolframscript run as expected. Maybe the
free CDF Player cannot give the full function.