dartpy icon indicating copy to clipboard operation
dartpy copied to clipboard

Does this work on mobile platforms currently?

Open Rickaym opened this issue 2 years ago • 7 comments

Rickaym avatar May 27 '22 09:05 Rickaym

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.

TimWhiting avatar Jun 02 '22 04:06 TimWhiting

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. (dart:ui/hooks.dart:159:23) E/flutter ( 9357): #10 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:296:19) E/flutter ( 9357): #11 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12) E/flutter ( 9357):

NiallBunting avatar Oct 21 '23 18:10 NiallBunting

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.

TimWhiting avatar Oct 21 '23 21:10 TimWhiting

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

tot14883 avatar Feb 16 '24 17:02 tot14883

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).

TimWhiting avatar Feb 16 '24 19:02 TimWhiting

This is the correct path. I checked on my iTerm. Uploading Screenshot 2567-02-17 at 08.58.19.png…

tot14883 avatar Feb 17 '24 02:02 tot14883

Im getting Unhandled Exception: ProcessException: Permission denied. by running this on android. Is it not compatible with mobile platforms?

Nilesh-d avatar Apr 12 '24 04:04 Nilesh-d