This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: clr: AttributeError: 'module' object has no attribute 'AddReference'
Type: Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Rany, r.david.murray, terry.reedy
Priority: normal Keywords:

Created on 2017-12-21 21:58 by Rany, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg308909 - (view) Author: Ranya (Rany) Date: 2017-12-21 21:58
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.
msg308912 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-12-21 22:43
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.
msg308913 - (view) Author: Ranya (Rany) Date: 2017-12-21 22:55
Could you provide me a link to contact the clr community please?
msg308921 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-12-22 04:58
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.
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76586
2017-12-22 04:58:47terry.reedysetassignee: terry.reedy ->
messages: + msg308921
components: - IDLE
2017-12-21 22:55:32Ranysetmessages: + msg308913
2017-12-21 22:43:08r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg308912

resolution: third party
stage: resolved
2017-12-21 21:58:48Ranycreate