Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas Eriksson 930 posts 1825 karma points
    Aug 04, 2010 @ 12:49
    Jonas Eriksson
    0

    Cannot import modules in IronPython (Umbraco 451)

    Hi!

    This might be an issue with the IronPython implementation. I tried importing modules in a python macro as such:

    import sys
    sys.path.append
    (r'\c:\inetpub\www.mysite.com\python')
    import myglobal

    But I get the error IronPython.Runtime.Exceptions.ImportException: No module named myglobal

    According to IronPython documentation the above should work (afaiu) as the file myglobal.py is located in the defined path.

    Some suggestions I found on the web pointed out that IronPython.Modules.dll might not have been referenced, tried adding ref to that also with no luck importing.

    import clr
    clr.AddReference("IronPython.Modules")
    import IronPython.Modules

    Anyone else had any luck importing -py-files?

    Regards
    Jonas

  • Jonas Eriksson 930 posts 1825 karma points
    Aug 04, 2010 @ 19:10
Please Sign in or register to post replies

Write your reply to:

Draft