Jump to content
Walid Alg

P4D Android external library

Recommended Posts

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
12 hours ago, pyscripter said:


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.

Untitled.png

Share this post


Link to post
5 hours ago, pyscripter said:

Dependencies:

Please make sure the following are installed before installing this library and in the following order:

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
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
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 by Walid Alg

Share this post


Link to post
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 by pyscripter

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×