2

This is the code I copy, and I want to learn to use Python.Runtime, but when it runs, it throws an exception.

"DLL" python2.7m "cannot be loaded: no specified module can be found. (the exception comes from HRESULT:0X8007007E). "

As a problem with a rookie. Thank you.

using Python.Runtime;
using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            using (Py.GIL())
            {
                dynamic np = Py.Import("numpy");
                dynamic sin = np.sin;
                Console.WriteLine(np.cos(np.pi * 2));
                Console.WriteLine(sin(5));
                double c = np.cos(5) + sin(5);
                Console.WriteLine(c);
                Console.ReadKey();
            }
        }
    }
}
denfromufa
  • 5,610
  • 13
  • 81
  • 138
Y.HC
  • 21
  • 3
  • Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [ask] page for help clarifying this question. – ProgrammingLlama Mar 21 '18 at 06:40
  • Thank you for your reply. Can you help me to look at it again – Y.HC Mar 21 '18 at 06:59
  • did you look at pythonnet troubleshooting wiki? – denfromufa Mar 26 '18 at 04:21

0 Answers0