dartpy
dartpy copied to clipboard
Does this work on mobile platforms currently?
Good question. I have not tried. Other people have though I haven't heard from them whether they have gotten it working. Theoretically it should be possible on Android at least. It probably gets tricky with python libraries / python library paths.
I tried running it on android and got:
Syncing files to device Android SDK built for x86...
E/flutter ( 9357): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ProcessException: Permission denied
E/flutter ( 9357): Command: python3.10-config --ldflags --embed
E/flutter ( 9357): #0 _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:487:7)
E/flutter ( 9357): #1 _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:632:18)
E/flutter ( 9357): #2 Process.runSync (dart:io-patch/process_patch.dart:68:12)
E/flutter ( 9357): #3 pythonDylib (package:dartpy/src/ffi/ffi.dart:31:24)
E/flutter ( 9357): #4 _pyLib (package:dartpy/src/ffi/ffi.dart:22:43)
E/flutter ( 9357): #5 _pyLib (package:dartpy/src/ffi/ffi.dart)
E/flutter ( 9357): #6 dartpyc (package:dartpy/src/ffi/ffi.dart:121:56)
E/flutter ( 9357): #7 matrix_test (package:cb/matrix.dart:19:3)
E/flutter ( 9357): #8 main (package:cb/main.dart:8:3)
E/flutter ( 9357): #9 _runMain.
You would have to set pyLibLocation
to the location where you put python's dynamic library. There are likely other environment variables / python setup you would have to do.
What is this error? this is my actual path.
Invalid argument(s): Failed to load dynamic library
'/Library/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib': dlopen failed: library
"/Library/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib" not found
Just what the error says: that path does not exist on whatever device you are running the app on. (If you are running on iOS then you would need to make sure that path exists on the iOS device, not the macOS device you are developing on presumably).
This is the correct path. I checked on my iTerm.
Im getting Unhandled Exception: ProcessException: Permission denied. by running this on android. Is it not compatible with mobile platforms?