Walid Alg 0 Posted September 30 I installed the external library moviePy on Windows using pip install, then I wrote a function in Python that performs a task using this library. Finally, I used this function in Delphi for Windows, and it worked. My question is: How can I install or include this library, or any external library, in an Android project, knowing that I am familiar with Python deployment based on the previous answer. https://en.delphipraxis.net/topic/12279-p4d-android-error/ Thank you. Share this post Link to post
pyscripter 689 Posted September 30 To automatically deploy python modules you need to use these related projects: Embarcadero/Lightweight-Python-Wrappers: Lightweight Wrappers based on Python4Delphi to make it easy to import Python modules into Delphi components. (github.com) Embarcadero/PythonPackages4Delphi: General collection of Python Packages wrapped for use in Delphi and C++Builder (github.com) Embarcadero/P4D-Data-Sciences: A collection of lightweight Python wrappers based on Python4Delphi simplifying Data Sciences development with Delphi (github.com) The second one already contains the wrapped MoviePy python package. 1 1 Share this post Link to post
Walid Alg 0 Posted September 30 12 hours ago, pyscripter said: To automatically deploy python modules you need to use these related projects: Embarcadero/Lightweight-Python-Wrappers: Lightweight Wrappers based on Python4Delphi to make it easy to import Python modules into Delphi components. (github.com) Embarcadero/PythonPackages4Delphi: General collection of Python Packages wrapped for use in Delphi and C++Builder (github.com) Embarcadero/P4D-Data-Sciences: A collection of lightweight Python wrappers based on Python4Delphi simplifying Data Sciences development with Delphi (github.com) The second one already contains the wrapped MoviePy python package. I have downloaded the Python Packages 4 Delphi library from the following link: https://github.com/Embarcadero/PythonPackages4Delphi/tree/main/src/MoviePy and installed it in the Delphi environment. Then, I placed the MoviePy component on the form. It has the properties autoImport and autoInstall set to true. I set the pyEnvironment property to the pyEmbeddedEnvironment1 component and the pythonEngine property to the pythonEngine1 component. However, when I call the moviePy1.isImported function, the value is false. I tried writing code to create an instance, but I received an error message. My question is: how do I use this MoviePy component? Is it enough to place it on the form, or are there additional settings required for it to work? Thank you. Share this post Link to post
pyscripter 689 Posted October 1 (edited) Dependencies: Please make sure the following are installed before installing this library and in the following order: Python4Delphi PythonEnvironments Lightweight-Python-Wrappers Each library depends on the one above it, once these are installed this library will also install Edited October 1 by pyscripter Share this post Link to post
pyscripter 689 Posted October 1 Also have a look at this sample from https://github.com/Embarcadero/P4D-Data-Sciences/. Share this post Link to post
Walid Alg 0 Posted October 1 5 hours ago, pyscripter said: Dependencies: Please make sure the following are installed before installing this library and in the following order: Python4Delphi PythonEnvironments Lightweight-Python-Wrappers Each library depends on the one above it, once these are installed this library will also install All ready have did. I have done this before, because the moviePy component requires modules from these libraries in order to function. Well, since the moviePy library is already installed on Windows, I added the moviePy component to the form and wrote an import code for it. It works as I’m just testing whether the moviePy component returns the value true for the isImported function. All of this is to check if the moviePy component works before switching to the Android platform. As I mentioned, the moviePy component is set up by default as I stated earlier, with the addition of pythonEngine and pyEmbeddedEnvironment. The problem is the same message appears, which is that when executing the isImported function, it returns the value false. Share this post Link to post
Walid Alg 0 Posted October 1 17 minutes ago, Walid Alg said: All ready have did. I have done this before, because the moviePy component requires modules from these libraries in order to function. Well, since the moviePy library is already installed on Windows, I added the moviePy component to the form and wrote an import code for it. It works as I’m just testing whether the moviePy component returns the value true for the isImported function. All of this is to check if the moviePy component works before switching to the Android platform. As I mentioned, the moviePy component is set up by default as I stated earlier, with the addition of pythonEngine and pyEmbeddedEnvironment. The problem is the same message appears, which is that when executing the isImported function, it returns the value false. As I understand it, to ensure that the component is working, the function should return the value true. Share this post Link to post
pyscripter 689 Posted October 1 Did you have a look at the sample I pointed out above? Share this post Link to post
Walid Alg 0 Posted October 2 (edited) 9 hours ago, pyscripter said: you have a look Yes, I did. It didn’t work for me due to the absence of PyTorch, I don't know which library it is in, but I understood the concept of how it works. That’s why the message appears in the Android application. An error occurred during the installation process: Edited October 2 by Walid Alg Share this post Link to post
Walid Alg 0 Posted October 2 If uploading the project helps in understanding and solving the issue, I will upload it for you. Thank you. Share this post Link to post
pyscripter 689 Posted October 2 (edited) 4 hours ago, Walid Alg said: Yes, I did. It didn’t work for me due to the absence of PyTorch, I don't know which library it is in, It is part of Embarcadero/P4D-Data-Sciences: A collection of lightweight Python wrappers based on Python4Delphi simplifying Data Sciences development with Delphi (github.com) This is a similar project to Embarcadero/PythonPackages4Delphi: General collection of Python Packages wrapped for use in Delphi and C++Builder (github.com) and uses the same infrastructure. You need to have a similar setup for using moviePy to the PyTorch sample. These repos have been developed and are being maintained by Embarcadero. I am not involved in them and have never used them. You should direct your questions and issues to the respective repos. Edited October 2 by pyscripter Share this post Link to post
Walid Alg 0 Posted October 2 thought about this attached project importLibrary because I think it is the key to the solution. I got an error message. 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