8000 StackOverflowException when importing third party libraries in .NET on macOS 14.5. · Issue #2396 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

StackOverflowException when importing third party libraries in .NET on macOS 14.5. #2396

@antheus-s

Description

@antheus-s

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:
image

Any help would be very appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0