Error upon importing numpy into embedded IronPython engine
Asked Answered
T

0

6

This is an extension to the question asked at:

How to install numpy and scipy for IronPython 2.7

I have successfully installed both packages and can import both from the command line with ipy.exe, but when I try to import numpy into an engine embedded in another .NET application, I get an error. Tracing the error in VS, I'm pretty certain the error is raised when importing multiarray. Specifically, upon the call to ModuleMethods.__init__() within multiarray.py. The error message is:

init() takes exactly 1 argument (0 given)

I am able to add the reference to NumpyDotNet and execute from NumpyDotNet import *

I do have these paths in my scope when I start up the engine: C:\Program Files (x86)\IronPython 2.7\Lib; C:\Program Files (x86)\IronPython 2.7\Lib\site-packages; C:\Program Files (x86)\IronPython 2.7\DLLs

So something else about my embedded environment must not be set up correctly (and it's not setting "Frames=True" in the options dictionary). I've seen other questions where people have similar problems but none where they seem to be getting this far and seeing this error message. In my case the numpy package is found and NumpyDotNet.dll is loaded.

Treblinka answered 2/2, 2017 at 22:45 Comment(1)
pythonnet isn't an option for me... I'm not in control of the hosting application.Treblinka

© 2022 - 2024 — McMap. All rights reserved.