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.
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!
It looks like some links are missing. Have you tried reinstalling .NET Framework or pyrevit?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.