I wanted to give IronPython a try since I want to learn more about both Python and the .Net underlay. I installed last version (2.7.3) and trying to import clr, on my first line, I can't run and throws the error "No module named CLR". I googled but didn't find anything on that matter. The IronPython install is pretty much straight forward, like all windows apps commonly are, so I can't find what did I miss here. Any clues?
2
votes
2 Answers
3
votes
Imports in python are case sensitive (PEP 235) even on case-insensitive platforms like (in your case) Windows. (There may be ways around that, but for the sake of compatibility I would not recommend using them.)
If you change your code to the correct, lower case spelling everything should work.
import clr
If that is not the issue a wrong (non-IronPython) interpreter/implementation might be the cause. If running through python tools for Visual Studio the setting at the project properties/General/Interpreter should show IronPython... and not the standard python implementation (Python...).