Am trying to use clr.AddReference and clr.AddReferenceToFile to import an assembly, but python(2.7) keeps making this error: Traceback (most recent call last): File "<pyshell#5>", line 1, in clr.AddReference("UnityEngine") AttributeError: 'module' object has no attribute 'AddReference' Can anyone tell me how to fix this.
Whatever clr is, it doesn't look like it is part of the Python standard library. Please contact the clr community for support on this package, or post to the python-list mailing list.
I am 99.99% sure that this is not an IDLE issue. IDLE submits your code to Python to be exec-ed. The exception comes from Python. You should get the same exception (though with a different fake file name) if you ran the same code directly with Python, without IDLE running.