Questions tagged [graalpython]

`graalpython` is name of GraalVM Python executable. GraalVM Python is Python implementation https://www.graalvm.org/python/. It is module of GraalVM, installed with `gu install python`, but also can be installed and used independently as any Python implementation. https://github.com/oracle/graalpython

graalpython is name of GraalVM Python executable. GraalVM Python is Python implementation https://www.graalvm.org/python/. It is module of GraalVM, installed with gu install python, but also can be installed and used independently as any Python implementation. https://github.com/oracle/graalpython

15 questions
1
vote
1 answer

Bundle GraalVM engine and graalpython with Java application

There is a way to run Python scripts that uses packages from Java using GraalVM and its Python module graalpython. Here is example https://github.com/paulvi/graalpython-java-template I wonder if it is possible to bundle GraalVM engine and…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
1
vote
1 answer

In graalpython what is difference between `ginstall` and `pip`?

In graalpython https://www.graalvm.org/python/ what is difference between ginstall and pip? Which one to use?
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
1
vote
2 answers

run Python in GraalVM - Operation is not allowed for: at org.graalvm.truffle/com.oracle.truffle.polyglot.FileSystems.forbidden(FileSystems.java:1345)

I play with GraalVM, running Python from Java import org.graalvm.polyglot.*; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class HelloPolyglot { public static void main(String[] args) { …
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
1
vote
2 answers

Encounter errors when install pandas inn graalpython

When I compile graalpython -m ginstall install pandas or graalpython -m ginstall install bumpy I got the following error, please comment how to fix the error. Thank you. line 54, in __init__ File "number.c", line 284, in array_power File…
madeinQuant
  • 1,721
  • 1
  • 18
  • 29
1
vote
1 answer

GraalVM polyglot native image with Python

I'm trying to run a polyglot native image with java/python. I'm able to create the native image with this command line: native-image --language:python javapython But when a run it with ./javapython it throws me this error: Startup failed, could…
Antonio
  • 115
  • 6
1
vote
1 answer

Create/Read files with Python in Graal VM

Im working with Graal VM, using combined languages like Java and Python. I have a problem when try to execute Python sintax to read/create files using context.eval(). I use this code using Graalpython in terminal: out_file = File.new("cadena.txt",…
Antonio
  • 115
  • 6
0
votes
0 answers

GraalVM Python Restrict Import Certain Modules

I am using GraalVM Python in my project https://www.graalvm.org/latest/reference-manual/python/ How do I restrict guest Python code from importing critical modules like "os" module, but still allow them to import safe whitelisted modules like…
Sebastian
  • 125
  • 9
0
votes
0 answers

Can GraalVM compiled code call methods from other GraalVM compiled code?

I've always been interested in the idea of a polyglot framework that allows steps in a pipeline of transformations to be written in arbitrary programming languages, as long as the transforming code provided a method with the appropriate signature…
jstur
  • 659
  • 6
  • 12
0
votes
1 answer

Module not found if graalpy is packaged in Spring Boot Jar

I'm building a Spring Boot (3 RC1) application with some Python code (GraalVM 22.3). Running the application in dev mode works. After building Jar with Maven I get an error: Caused by: org.graalvm.polyglot.PolyglotException: ModuleNotFoundError: No…
0
votes
1 answer

Cannot compile Spring Boot to native image with Python language support

I'm trying to build a native image (GraalVM 22.3) from a Spring Boot 3 RC1 application with Python language support on Apple M1. I can build the native image without Python language support. But when adding
0
votes
1 answer

How to execute a python script in Spring Boot with GraalVM?

I'm struggling executing a python script in a Spring Boot application with GraalVM. The code works without Spring Boot in a simple library. The problem is that there are no members found and pystacCreatorClass is null. The context seems to be ok,…
0
votes
0 answers

How to get GraalVM guest language traceback?

I'm trying to call some Python code from Java on GraalVM (22.2.0), but for Python exceptions I only get back the message and no traceback. As opposed to running the code via the interpreter: $ graalpython bar.py Traceback (most recent call last): …
Flygsand
  • 115
  • 1
  • 8
0
votes
1 answer

Importing a local python file in an embedded graalpython script fails

Is it possible to import a local python script in another script that is run from Java using graalpython? On the Java (Scala) side, the code looks like this: val context = Context.newBuilder("python"). allowAllAccess(true). …
Allan
  • 81
  • 10
0
votes
1 answer

How to add package to graalpython known packges list?

graalpython -m ginstall install --help will list packages known to graalpython: Known packages are pytest, pytest_parallel, py, attrs, pyparsing, packaging, more_itertools, atomicwrites, pluggy, zipp, wcwidth, PyYAML, six, Cython, setuptools,…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
0
votes
1 answer

run Python in GraalVM - `import requests` fails with Exception: You need either charset_normalizer or chardet installed (requests init failure)

I try to run Python script in GraalVm and it fails on import requests And it seems GraalVM issue, as the script work with usual python3. Java code: import org.graalvm.polyglot.Context; import org.graalvm.polyglot.Source; import…
Paul Verest
  • 60,022
  • 51
  • 208
  • 332