Environment
- Pythonnet version: 3.0.3
- Python version: 3.8.x, 3.9.x, 3.10.x, 3.12.x
- Operating System: macOS Sonoma 14.5
- .NET Runtime: .NET 7
Details
-
Describe what you were trying to get done.
Use numpy and fasttext in .NET
-
What commands did you run to trigger this issue? If you can provide a
I have setup a python environment, first with pyenv and now with conda, but both do not work as expected with pythonnet.
I have configured everything according to the docs, which works fine for importing things such as the default math library, but whenever I try to import a third party library, such as numpy or fasttext, I get a StackOverflowException. If I uninstall the library, I get a Module not found exception, which is to be expected.
using (Py.GIL())
{
FastText = Py.Import("fasttext");
Model = FastText.load_model(ModelPath);
}
The exception points me to here (Runtime.cs:1553), which does not really give me any information:

Any help would be very appreciated.