import numpy asynchronously causes EXC_BAD_ACCESS

Open
#85 10 comments 1 reaction 1 assignee View on GitHub

@FeodorFitsner is already working on this.

Since Apr 24, 2024.

Assessment

This issue has not been assessed yet.

Description

bug

Hello,
the package is amazing, but I encountered an error that makes it impossible to continue developing.
I am working on macOS with an Apple Silicon processor (M2).
The line import numpy as np always makes the code (and the whole flutter app) crashes with EXC_BAD_ACCESS, specifically, I tracked down the error to the line let result = PyRun_SimpleFileEx(file, appPath, 1) in SeriousPythonPlugin.swift.
The interesting thing is that if I use sync: true, the python code gets executed correctly without issues, but the flutter app hangs, so it's not a viable solution.
I've tried using Isolates, but either the method channel cannot be invoked, or the flutter UI hangs (if I use BackgroundIsolateBinaryMessenger.ensureInitialized).
Let me know if I can provide more info.

Dominant language
Dart
Stars
324
Forks
47
Avg merge
7h 41m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flet-dev/serious-python

All issues in flet-dev/serious-python

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.