0

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

  • This is possible a conflict with IronPython 2.7.3 in Dynamo. Try switching the pyRevit engine to this version and test again – Ehsan Iran-Nejad Sep 19 '20 at 16:45
  • 1
    Hi! Thank you very much for answering! I changed the active engine to IronPython(273) in pyRevit settings. But it still doesn't work... the error now is 'no module named wpf', like in the second image I added to the post – Tais Magalhaes Sep 21 '20 at 07:02

2 Answers2

0

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

AdiletB
  • 77
  • 3
0

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.

onomou
  • 1
  • 3