Re: Ironpython 2.7.9 ImportException: 'No Module Named errno' when importing another module in .NET application

Stéphane Lozier
 

I think it was in lexer.py, there's something like:

try:
   eval("foo",...)
except SyntaxError:
   ...
else:
   import ...
   ...

The SyntaxError is thrown on the import. If you move the import into the try clause after the eval the exception will be caught and it'll work with IronPython.

Beyond that I have no idea if there are other incompatibilities since I've never used this module.

On Fri, Nov 30, 2018, 6:01 PM micoo via Groups.Io <micoo=microsoft.com@groups.io wrote:
Appears I misled us. The IronPython.Modules assembly was not getting copied to bin but not the directly the app was actually running from. 

I threw:
            Action<Type> noop = _ => { };
            noop(typeof(IronPython.Modules.CTypes));
 
at the top of the class and the assembly is loaded the and errno error is gone.

I'm able to execute scripts now pretty easily, and am hitting a Syntax Error when importing jinja2 like you mentioned:


Non-ASCII character '\xc2' in file C:\Python27\Lib\site-packages\jinja2\_identifier.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Tried a number of searches and tweaks. Do you have more specific knowledge on what needs to be patched to enable jinja2? Does it require a specific verson? We're currently targeting 2.10

Thanks for your help! 

Join users@ironpython.groups.io to automatically receive all group messages.