My pyRevit has been acting strangely lately. Every now and then, the pyRevit tab will just disappear from Revit. Even stranger, my custom extensions are still there. The buttons all work, but the hooks for those extensions don’t seem to work. Usually the only way to fix it is to delete the pyRevit and pyRevit master folders, and then re-install pyRevit, but that is only temporary and after a while, pyRevit disappears again. Any ideas as to why this would happen?
Just to get started, what version of pyRevit are you using & version(s) of Revit this is occurring in? May be best to run pyrevit env
in a command line interface & paste the output here.
It’s happening in 2022-2024. I’m currently using pyRevit 4.8.16.24121. However I had the pyRevit 5 WIP installed for a while before going back to this. Below is the output from the command prompt
C:\Users\dennis.goff>pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
==> Attachments
Unknown | Product: "Autodesk Revit 2024" | Manifest: "C:\Users\dennis.goff\AppData\Roaming\Autodesk\Revit\Addins\2024\pyRevit.addin"
Unknown | Product: "Autodesk Revit 2023" | Manifest: "C:\Users\dennis.goff\AppData\Roaming\Autodesk\Revit\Addins\2023\pyRevit.addin"
Unknown | Product: "Autodesk Revit 2022" | Manifest: "C:\Users\dennis.goff\AppData\Roaming\Autodesk\Revit\Addins\2022\pyRevit.addin"
==> Installed Extensions
pyZebraGoldFish | Type: Unknown | Repo: "" | Installed: "C:\Users\dennis.goff\PyCharm Projects\ZebraGoldFish Extensions\ZebraGoldFish\pyZebraGoldFish.extension"
pyZebraGoldFishHooks | Type: Unknown | Repo: "" | Installed: "C:\Users\dennis.goff\PyCharm Projects\ZebraGoldFish Extensions\ZebraGoldFishHooks\pyZebraGoldFishHooks.extension"
==> Default Extension Search Path
C:\Users\dennis.goff\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
C:\Users\dennis.goff\PyCharm Projects\ZebraGoldFish Extensions\ZebraGoldFish
C:\Users\dennis.goff\PyCharm Projects\ZebraGoldFish Extensions\ZebraGoldFishHooks
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2025 | Version: 25.2.0.38 | Build: 20240715_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2025\"
Autodesk Revit 2024 | Version: 24.2.20.41 | Build: 20240814_1400(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
Autodesk Revit 2023 | Version: 23.1.50.23 | Build: 20240709_1030(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023\"
Autodesk Revit 2022 | Version: 22.1.70.9 | Build: 20240704_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
==> Running Revit Instances
Error: Object reference not set to an instance of an object.
Run with "--debug" option to see debug messages
C:\Users\dennis.goff>
Hmm, well I’ll say I’ve not personally heard of the issue that you are facing before - but I’m sure someone here has.
The one thing that I’d do in that case & after looking at your environment information is to register the clone w/ pyRevit CLI & (re)attach pyRevit to your Revit instances. Depending on your order of operations in terms of installing & uninstalling, downloading the WIP could have cause some jankiness to occur
You can find the info on how to add your already downloaded clone at the Notion page here, and then once its registered you can run pyrevit detach --all
to detach pyRevit & use the attach command to re-attach it to your Revits. The info for that is linked here.
Side note: I’d double check you’re using the 4.8.16 CLI by running
pyrevit -V
and checking the output. If for some reason you have the WIP CLI still installed & your PATH is pointing to it, it can cause issues when attaching/detaching
Again this is just what I’d do to start troubleshooting as I’m not sure what the cause for this issue may be. Hopefully this resolves it or someone else comes along with a better fix.
Do you have a lot of tabs/addins installed?
Revit has a limit on how many tabs can be loaded by the API.
It loads the addins in alfabetical order.
Try to disable some tabs, or rename the pyrevit.addin file to “0_pyrevit.addin” to force it to load other tabs first.
I recommend DiRoots AppManager to handle disable/enable addins if this is the cause for your problems.
the plot thickens. After running pyrevit -V I got this:
C:\Users\dennis.goff>pyrevit -V
pyrevit v4.8.14.24016+1909.ee814ee2f686d23db8bb6ff80d8bb918ff9adc99
That’s the older version i had prior to the WIP. I also noticed in my add/remove programs, i have both pyrevit 5.0.0 and 4.8.16 ( but not 4.8.14) I just spent an hour watching IT try to uninstall those with no luck. I assume that having these 3 all hanging around is causing the issue.
It will likely be some lurking registry keys most likely. I’ve had this issue in the past caused by users installling more than one pyrevit and using the exe installers.
Ah yes, I’ve had that before where my pyRevit installs get intermingled. Whenever that happens I’ll go to the install locations for pyRevit, such as C:\Program Files
for a global install & manually delete the pyRevit folder, then delete the associated pyRevit folder in C:\Users\user\AppData\Roaming
, and even the pyRevit folder in C:\ProgramData
to be quite thorough. I’d also clean out your PATH
environment variable (user or global, or both) of any pyRevit materials, such as the path to CLI which doesn’t get uninstalled when running the uninstaller.
After that go ahead & reinstall pyRevit and go from there. It is a couple steps to do a full pyRevit purge, but may just do the trick.
Yes I think this was the issue. I managed to find the registry keys for the versions that I couldn’t get to uninstall. That seemed to get rid of everything and then i re-installed. Seems to be working (for now)
I spoke too soon. While the registry keys did get rid of the other installed pyrevit versions, i am still losing my pyRevit tab. I have been able to consistently reproduce the issue though.
- I get our base pyrevit installation setup.
- I open revit and then add my custom extension paths, save and reload
- Close and re-open revit
- pyRevit tab is gone, but custom extension tabs are present(missing a few buttons…). no hooks work
It seems to me that there is some issue with my pyrevit_config.ini file maybe? When i replace the ini file with the original, the tab comes back. Is there anything that can cause a ini file to be corrupted or broken?
Ok I found the problem finally. I went through each panel/button disabling things until it stopped. Turns out, I had a line of code in one of my smartbuttons that checked for document in a try/except. Under except it was running sys.Exit() which completely halts all the pyrevit stuff from being created. Thanks all for your input, and as usual, it was my fault
‘la solution plus simple est souvent la bonne’