File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,24 @@ To try it, you can use the bundled releases from
14
14
some examples of what you can do with it, check out the
15
15
[ reference] ( https://www.graalvm.org/docs/reference-manual/languages/python/ ) .
16
16
17
+ ### Create a virtual environment
18
+
19
+ The best way of using the GraalVM implementation of Python is out of a virtual environment. This generates
20
+ wrapper scripts and makes the implementation usable from shell as standard Python interpreter. To do so
21
+ execute the following command in the project directory:
22
+
23
+ ```
24
+ mx graalpython -m venv <dir-to-venv>
25
+ ```
26
+
27
+ To activate the environment in your shell session call:
28
+
29
+ ```
30
+ source <dir-to-venv>/bin/activate
31
+ ```
32
+
33
+ In the venv multiple executables are available, like ` python ` , ` python3 ` and ` graalpython ` .
34
+
17
35
### Installing packages
18
36
19
37
At the moment not enough of the standard library is implemented to run the
Original file line number Diff line number Diff line change @@ -79,3 +79,22 @@ The C implementation and headers for our C API are in
79
79
` graalpython/com.oracle.graal.python.cext ` . The naming is analogous to C
80
80
Python's source names. This folder also includes a ` modules ` folder for built-in
81
81
modules that we have adapted from C Python.
82
+
83
+ ##### Debug options
84
+
85
+ The GraalVM implementation of Python provides proper debug options. It is possible to either debug the Python code, using Chrome debugger,
86
+ or the java code, using your preferred IDE.
87
+ The following commands should be executed in a virtualenv environment, which provides a graalpython executable.
88
+
89
+ For debug Python side code call this:
90
+
91
+ ``` graalpython --inspect your_script.py ```
92
+
93
+ This will open a debug server, which can be accessed in Chrome Browser under URL ` chrome://inspect ` .
94
+
95
+ For debugging java implemented code execute:
96
+
97
+ ``` graalpython --experimental-options -debug-java your_script.py ```
98
+
99
+ The command will also start a debug server, which can be used in an IDE. If the IDE was initialized properly
100
+ by using the command mentioned above, the existing ` GraalDebug ` run configuration can be used to debug.
You can’t perform that action at this time.
0 commit comments