-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module Install Error does not appear to be firing OnInstallError #9
Comments
Further investigation Tracked issue down to happening here https://github.com/Embarcadero/Lightweight-Python-Wrappers/blob/main/src/PyPackage.pas#L364 At some point during this call it raises an exception which is why the OnError isn't called (it never gets that far) I have only seen this happen on Android - tested with https://github.com/peardox/P4D-Tests - project dir "01 - Hello CPU FMX" It works fine on other platforms - as Memory is a possible issue the project has largeHeap enabled |
You're trying it on Android, but you're not placing the Python interpreter and executable in the App lib folder. Try that new deployment feature I've last introduced and it will work, or you can deploy it by yourself. |
Oh, rats - sandbox... One of these then... For proper stuff on Windows I set this to System.IOUtils.TPath.GetHomePath + '/appname' Possibly in Android it wants... |
Haa... you've almost got it. |
Sadly the error is from importing PSUtil (it's not big) |
Ah, an OpenGL memory lack :/ |
I'll try it on my TV (via NVIDIA Shield TV - it's got a small GPU in it...) |
Isn't it for streaming only?
|
Finally worked out how to get ChromeBook installs of APKs (Delphi will say it can't - adb install ... says otherwise) My test app (the FMX version) - https://github.com/peardox/P4D-Tests - is now more functional but still won't load any libs on Android. Note that Unit1.pas has some $DEFINES at the top you can use to switch modules in and out for testing Video (sorry about the audio - had a ChomeBook howto in background...) HelloCPUFMX.mp4Note that although I recorded this from the ChromeBook (easiest to record) this is what happens on EVERY device I've tried so far (Huawei Phone, Samsung Tablet, NVIDIA Shield TV and the ChromeBook - I've got more as well [Amazon rubbish devices]...) This error is happening in the same routine I reported yesterday. I could always test on a high-end Droid but then I'll have to work out how to use AWS's Device Farm (much simpler locally) - also, I'd expect at least the smaller packages to install ok - but nothing does... |
I will get it working for you. |
BTW, are you trying to install Torch for Android? The default Torch version is not available for Android. |
That was just the first in order in the video, before it was PSUtils Torch should install OK, it'll just come in without CUDA - at least this is what happens on arm64 SBCs like the NVIDIA Jetson - like this...
Should actually be able to get the CUDA extensions on that thing |
Torch is an extension module. It must be compiled with Android NDK toolchain to work on Android. They don't have it available on PYPI, you need to build it yourself from source. |
BTW - Has this bunch of packages actually been tested on physical Android? |
That sample is for showcase only purpose, and it's totally useless on real world. There's no Python running in the Android side. We collect and send images to the datasnap server. We can also order training and live recognition, but it all runs in the server side. |
I'll check that out but disabling Torch in HelloCPUFMX so it just tries PSUtil also acts the same I hate it when things that should work don't :( |
I was wondering if it worth to spend some time to create the Torch installer file for Setuptools for Android. |
PSUtil has a source distribution on PYPI, so it works :) |
It works, you only need to find its way, though. |
I just noticed that PSUtil and Torch had AutoInstall + AutoImport checked (the default) so turned those off as the test installs and imports them itself. No difference though. AutoInstall + AutoImport - seems to me they should default to false |
You need to place the Python shared library and executable in the same folder as your app. You MUST deploy it to "library\lib\arm64-v8a" if you're doing it 64-bit. Enabled Python, select a version and it will automagically set it up for you. Finally, drop a TPyEmbeddedEnvironment and it will do all the job. -> You still need the TPythonEngine. |
You need to setup that environment variable, as followed in that img above. |
Am I meant to extract the ZIPs or summat? |
https://github.com/Embarcadero/PythonEnviroments/tree/main/python/android/3.10.4/arm64 The shared library is missing, sorry. Get it from the .zip file and place it in that folder. |
That got Python working Now that thing sets all the paths yeah? |
Yeah, that rocks. |
Still no module install though :( Exception = EPyModuleCheckInstalledError |
Make your project as simple as possible and share it here. |
Noticed on old Android Tablet 32 with 3GB RAM
I was not getting any notifications at all so wrapped everything in try ... except and see I'm getting a PyModuleCheckInstallError but the event never fires
The text was updated successfully, but these errors were encountered: