Sorry for not being clear. I have written a script to extract a bunch of data from Revit and save it to a csv. When I wrote it I put all of the definitions in a separate file and saved it in the extensions folder in a folder.lib per the pyRevit instructions.
When I manually open Revit, load a project and run the script from the ribbon, it executes with no errors and saves all data to the csv. At the start of the process, I print all modules in the sys.path to a text file (image in post one). In the image you can see that I have several modules loaded from a folder.lib location.
When run from the CLI Revit opens and starts to run the script. It then errors out when I try to load the modules from my folder.lib location. The error is cannot find module xxxx. The screenshot from my second post is the sys.path when run from the CLI. As you can see it has not loaded any modules as it did in the run before.
When Revit is started manually pyRevit auto runs its start-up script that loads everything in a folder.lib to the sys.path. When run from CLI it appears that this start-up script is not running as no extra modules are being added.
I have dug a little deeper and found this page. I think I need to do the Extentions Run section but I cannot get it to work. This is just a hunch and I may be completely off.
I hope that helps, if you require more information please let me know,