Numpy cannot be imported when .py file is used by C #

numpy 64-bit support in PTVS and numpy System.Int64 casting

Hello everybody,

I have a Python file that imports numpy and function inside. When I launch this using Ironpython through Visual Studio, it works, but when I launch it from C #, it crashes while this line is running:

dynamic test1 = ipy.UseFile("IronPythonApplication1.py");

Since it cannot import numpy, this is what I think, because I get this error in a few seconds. Then the window closes.

It says:

"failed while initializing npycoreapi:badimageformat exception 
NumpyDotNet.NpyCoreApi.GetNativeTypeInfo<int32& intSize,............................."

This is my Python code:

import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\DLLs')
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib\site-packages')

import numpy as np

def deneme():
    x = np.arange(100).reshape((10,10))
    return x
+3
source share

All Articles