Skip to content

Commit 25ff8c6

Browse files
committed
add docs for using local interpreter
1 parent 197cf19 commit 25ff8c6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% pyscript_setup config='{"interpreter":"/static/pyodide/pyodide.mjs"}' %}

docs/src/reference/template-tag.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,3 +391,17 @@ You can optionally use this tag to configure the current PyScript environment. F
391391
```python
392392
{% include "../../examples/python/pyscript-setup-config-object.py" %}
393393
```
394+
395+
??? question "Can I use a local interpreter for PyScript?"
396+
397+
Yes, you can set up a local interpreter by following PyScript's [standard documentation](https://docs.pyscript.net/latest/user-guide/offline/#local-pyodide-packages).
398+
399+
To summarize,
400+
401+
1. Download the latest Pyodide bundle from the [Pyodide GitHub releases page](https://github.com/pyodide/pyodide/releases) (for example `pyodide-0.26.3.tar.bz2`).
402+
2. Extract the contents of the bundle to your project's static files.
403+
3. Configure your `#!jinja {% pyscript_setup %}` template tag to use `pyodide` as an interpreter.
404+
405+
```jinja linenums="0"
406+
{% include "../../examples/html/pyscript-setup-local-interpreter.html" %}
407+
```

0 commit comments

Comments
 (0)