Lightweight-Python-Wrappers icon indicating copy to clipboard operation
Lightweight-Python-Wrappers copied to clipboard

Importing a package?

Open peardox opened this issue 3 years ago • 4 comments

I've got Python4Delphi (P4D) and PythonEnvoronment working together in a very crude REPL fashion for testing purposes as an Embedded Python 3.9 (can't use higher - ONNX....)

If I try something simple like... import numpy

Obviously this raises an import exception in P4D as the PythonEnvironment has hardly any libraries. What I'd like to therefore do is handle the exception and import numpy.

This repo appears to include the functionality to add a library, e.g. numpy (importing libraries in general via PIP are what I'm trying to get working)

Some guidance on how to get PIP to add any library (like numpy) to my Embeded Python would be very much appreaciated (I'm positive this is something other people will want to know as well)

Note: I know this project is very new so apologies for hassling you. I'm also aware numpy is probably not the best example as it'll raise a DivByZero - or maybe that does make it a good example - who knows?

Edit: Looking through the source it appears I'm after Import for an un-managed package

peardox avatar Jun 10 '22 12:06 peardox

Hi, @peardox!

We are working on documentation for these new projects. I hope to get it available soon.

lmbelo avatar Jun 29 '22 12:06 lmbelo

I've been wrapping modules with P4D-Data-Sciences as a work-around so it works (in a slightly clunky manner)

There is the issue with progress not working - I guess that is part of this project (it's hard working out where to report issues)

I've got a very promising project that shows all this stuff off nicely using Fast Neural Style via PyTorch - there should be a Discord or Forum for this stuff where we can swap ideas and help each other out...

peardox avatar Jun 29 '22 12:06 peardox

The progress will be implemented as a feature locally, it is not functional in the current implementation.

We are setting up a Discord channel. I will invite you to join us.

lmbelo avatar Jun 29 '22 12:06 lmbelo

Look forward to the Discord - there are some examples of the output from my project in my own Discord - https://discord.gg/e2rGEEHrBd (you can PM me the invite there...)

peardox avatar Jun 29 '22 13:06 peardox