This is a followup question to packages will not load.

I can get SamplePackage to load by doing <<SamplePackage.m or <<SamplePackage' but I cannot get TMPClasses.m package to load, which I took from 'The Mathematica Programmer' by Maeder. Initially, TMPClasses.m was in ...Applications/myPackages/ and wouldn't load. I had myPackages in the search path. Since SamplePackage would work I tried to make the situation as symmetric as possible by renaming myPackages folder to TMPClasses, the same name as the package. The SamplePackage.m file is in a folder named SamplePackage. Except for the contents of the files themselves and the order the folders are placed in the search path I cannot think of any other asymmetries between the two situations. Any ideas on why this won't work? See the images below to see what I tried as well as the file structure.

As you can see, both files can be found:

As was suggested to me in the previous question I posted, for both packages I tried making a Kernel directory in the same directory as the .m file. In the Kernel directory I placed an init.m file with the contents Get["SamplePackage'SamplePackage'"] or Get["TMPClasses'TMPClasses'"]. After doing this, SamplePackage still loaded properly, and I was able to access the functions, and TMPClasses still would not load.

• Keep things simple. Packages should be placed in $UserBaseDirectory/Applications, and not in a subdirectory of $UserBaseDirectory/Applications (at least not until you have a full understanding of what that does). Do not create any Kernel directories. That is for package authors who create multi-file packages. You should not do that when you simply want to install a package. – Szabolcs Jun 23 '20 at 7:01
• Get["somefile"] will evaluate the contents of the file returned by FindFile["somefile"]. This is what loading means. If Classes is not defined, then most like the file did not have a definition for Classes within. Double-check the contents of the exact file returned by FindFile. – Szabolcs Jun 23 '20 at 7:06
• There are some anomalies in what you show in the screenshot: $Path appears to be the first evaluation, yet it contains paths that should not be there by default (such as your SamplePackage directory). Did you add something to your init.m? Do not do this: it is not necessary and every modification you make (but do not mention) makes it harder for us to debug your problem. – Szabolcs Jun 23 '20 at 7:09 • Keep things simple, and try to give a complete and concise description of the problem. Be sure to include a minimal example where you mention every detail. Last time you neglected to mention that you put your files in subdirectories and not on the $Path, which ended up wasting a lot of time. – Szabolcs Jun 23 '20 at 7:10
• Finally, \$Packages is irrelevant for this problem. You do not need to bother with it. But please: explain the problem in a clear, structured way, and provide a complete minimal example: sscce.org Use the structure I suggested here. – Szabolcs Jun 23 '20 at 7:11