SciSharp/Numpy.NET

Application hang when a project is launched in a fresh windows account

roopeshReddy888 opened this issue · 8 comments

Hi, this is Roopesh. I am consuming Numpy.net in our project. I am facing an error that the application gets hanged if I open my application on a freshly created Windows account. The error seems to be a wait on an async method that initializes the python environment. Please find attached a screenshot of the stack trace highlighting the application hang.

Any update on how to fix it would be of great help to us.

Thanks and Regards,
Roopesh

numpy net_issue

henon commented

Please read the section on the main readme about deadlocks: https://github.com/SciSharp/Numpy.NET#multi-threading-must-read

Hi Henon. Thanks for the reply. I did read that but I was getting an exception that Python37dll is not available in the bin folder. Also, we are not operating with multiple threads here, it's the numpy method (np.eye) that is calling an async method. Secondly, if I run the app for the second time onwards in a newly created windows account, I don't see this issue. This is making us more puzzled about what could be the potential fix for the same.

henon commented

Numpy.NET is based on Python.Included which on the first run installs the python runtime in your user directory. Your stacktrace shows that it waits indefinitely in InstallAndImport for whatever reason
image
I am guessing it is some kind of permission problem?

The only thing I can suggest is installing visual studio on that machine and execute numpy.net from source to see why exactly it hangs where it hangs. You can also try to delete the python runtime which Numpy installed in your user directory from your developer machine and see if the same happens for you then.

Will try and get back. Thanks, Henon.

Hi Henon. We managed to fix this issue. Thanks a lot for your suggestions.

henon commented

How did you fix it? Please let me know and also for others who find this issue. Thanks

Sure. We were calling np.eye() method, which was trying to initialize python and failing. So we started a new task, in that called np.eye() method, and after some time killed the task. Then continued with the code. This fixed it.

Hi, I'm facing the same problem and not sure I understand this solution. It sound like you just let the call to np.eye() timeout without being able to get the result? How were you able to get the Python initialization to stop failing in order to use the library?