Walid Alg 0 Posted October 4 I want to integrate Python libraries into an Android application in a Delphi environment. In general, to run a Python environment in an Android application, the environment must first be embedded and loaded from within Delphi by selecting Python and the version type. Then, it is eventually integrated with the application and appears in the form of an SO file. What I am trying to do is figure out how to install any external Python library and run it in an Android application using Delphi. I tried installing the MoviePy library through this link: https://github.com/Embarcadero/PythonPackages4Delphi/tree/main/src/MoviePy but it didn’t work. I also tried the attached project: https://github.com/Embarcadero/P4D-Data-Sciences/tree/main/samples/InstallAndImport which includes the PyTorch library. Both have the properties autoImport, autoInstall set to true, and the MoviePy and PyTorch components are set up by default as I stated earlier, with the addition of pythonEngine and pyEmbeddedEnvironment. But neither worked. The problem is the same: the same message appears, "no module named pip". which is that when executing the isImported function, it returns the value false. Share this post Link to post
pyscripter 694 Posted October 5 (edited) As I said, I have no experience of using these components. But if you look at P4D-Data-Sciences/demos/PyTorch/PyTorchTimeSequencePrediction/MainForm.fmx at 551db5923fad9a9e8384169233dd64ddf9f87d12 · Embarcadero/P4D-Data-Sciences (github.com) you will see that a PythonEnvironments addon EnsurePip is used. Edited October 5 by pyscripter Share this post Link to post
Walid Alg 0 Posted October 5 (edited) 15 hours ago, pyscripter said: As I said, I have no experience of using these components. But if you look at P4D-Data-Sciences/demos/PyTorch/PyTorchTimeSequencePrediction/MainForm.fmx at 551db5923fad9a9e8384169233dd64ddf9f87d12 · Embarcadero/P4D-Data-Sciences (github.com) you will see that a PythonEnvironments addon EnsurePip is used. Pip is defualt setting, other is corda lib or.. I forget his name. I have posted this in several forums and communities that focus on Delphi, but I haven't found any answers regarding the use of P4D in the Android environment, let alone a solution to the problem. The only person who has responded to me on this topic so far is you. Edited October 5 by Walid Alg Share this post Link to post
Walid Alg 0 Posted October 5 17 hours ago, pyscripter said: As I said, I have no experience of using these components. But if you look at P4D-Data-Sciences/demos/PyTorch/PyTorchTimeSequencePrediction/MainForm.fmx at 551db5923fad9a9e8384169233dd64ddf9f87d12 · Embarcadero/P4D-Data-Sciences (github.com) you will see that a PythonEnvironments addon EnsurePip is used. pyEmbeddedResEnvironment310 is available in any library, thank you Share this post Link to post
Walid Alg 0 Posted October 5 It works, I don't know why, but after reinstalling the Python library for Windows from the official website, the latest version, I found the application in Delphi working and installing external libraries like PyTorch inside Delphi. Additionally, the function isImported returns true. Now my question is, on Android, I tried the same application that works on Windows, but it didn’t install the PyTorch library, for example. In the settings, ManagerKind = pip / conda. Using pip on Windows works to install the library, but conda doesn't work for installing the library. I tried both pip and conda on Android, but neither worked. Can you help with this? Share this post Link to post
Walid Alg 0 Posted October 14 "I found a temporary solution, but it's not complete." SVID_20241014_215009_1.mp4 Share this post Link to post