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 <module>
clr.AddReference("UnityEngine")
AttributeError: 'module' object has no attribute 'AddReference'
Can anyone tell me how to fix this.
Once I met this issue.
There is a package named clr while the pythonnet package's alias is also clr.
So I removed clr by "pip uninstall clr
" and then installed pythonnet by 'pip install pythonnet
'.
Finally, everything works well.