It does not print the path for the .lib extension.
The paths listed are:
1. Path to the .extension where the "startup.py" is located
2. %localappdata%\\MyOrg\\pyRevitClone\\pyrevitlib
3. %localappdata%\\MyOrg\\pyRevitClone\\site-packages
4. %localappdata%\\MyOrg\\pyRevitClone\\bin
5. %localappdata%\\MyOrg\\pyRevitClone\\pyrevitlib\\pyrevit\\loader\\addin
6. %localappdata%\\MyOrg\\pyRevitClone\\bin\\engines\\2711
7. %localappdata%\\MyOrg\\pyRevitClone\\bin\\engines\\IPY2711PR
8. %appdata%\\pyRevit
9. %appdata%\\pyRevit\\2023
10. %appdata%\\pyRevit\\Extensions
11. %localappdata%\\MyOrg\\pyRevitClone\\bin
12. %localappdata%\\MyOrg\\pyRevitClone\\bin
13. %localappdata%\\MyOrg\\pyRevitClone\\bin
I’m not sure why it list the bin-folder 4 times?
The goal is to set up the following extensions.
AVA.lib (renamed to not have the same name as main extension)
AVAssistent.extension
AVAdmin.extension
AVBeta.extension
AVElectrical.extension
AVMEP.extension
Our extension is currently deployed as one .extension with multiple tabs.
The new extenson setup contain one .tab-folder in each extension. The reason is that we want to install them independently and not load all tabs on startup, as we need to “save” on the number of tabs Revit API can load.
I tried to append the AVA.lib folder to sys.path but now it lists less paths, missing all paths after the .lib path (like it throws an exeption?).
The extension.json for the .lib defines the type as a lib-extension.
Do you confirm that the problem is only with the startup.py script? I believe this is by design, as stated in the message I reported, and as you can see by the sys path: the other extension are not included to avoid hurting the load process (whatever it means).
If the other scripts are working fine after a reload, the only workaround I can think of is to turn the startup.py into a stand alone module, or rely only on modules inside its .extension folder.
I know this is not perfect because it introduces duplicate code, but sometimes we need to compromise…
It might be a bug in the (re)load process, but it doesn’t hurt
Every time you install pyRevit it adds an entry to the system path even if it already exists. Super annoying when testing installation scripts and end up with 20+ duplicates… maybe this is what you are seeing?
Yes, the problem is only with the startup.py, all other imports works as expected, across all extensions.
Can also confirm it works if I duplicate the needed modules and add them to the .lib-extension.
I tried to duplicate the startup.py to the .lib-extension, but it seems to not load in the .lib I think? The test print statement is not shown for “Hello from AVA.lib”, only the “Hello from AVAssistent.extension” is output.
So separate/duplicate libraries/modules for the startup.py seems to be the workaround for now.