Can't use pyrevit forms

466 views Asked by At

I am trying (for a long time) to use pyrevit forms to open excel files, but everytime I try to use it, a different error appears. The most recent error is the one in the image. enter image description here

If I try 'from pyrevit import *', the error is: Exception : System.MissingMemberException: 'module' object has no attribute 'compat'

Does anyone have any idea what I'm doing wrong? I don't know what else to do... Sorry for my ignorance. Thank you very much in advance!

new error message: enter image description here

2

There are 2 answers

1
AdiletB On

It looks like some links are missing. Have you tried reinstalling .NET Framework or pyrevit?

0
onomou On

The problem may be with from pyrevit import * because it is not in your PATH. I was able to use pyRevit forms by adding its library and additional packages folders like this:

import sys
sys.path.append(r'C:\Users\<username>\AppData\Roaming\pyRevit-Master\pyrevitlib')
sys.path.append(r'C:\Users\<username>\AppData\Roaming\pyRevit-Master\site-packages')
from pyrevit import forms

Just replace <username> and paste into RevitPythonShell, provided pyRevit is installed in the default location. Other pyrevit modules should work similarly.