2021-08-11 10:00:44 +00:00
(downloading_deploying)=
# Downloading and deploying Pyodide
## Downloading Pyodide
### CDN
2022-06-22 03:15:37 +00:00
Pyodide is available from the JsDelivr CDN
2021-08-11 10:00:44 +00:00
2022-05-30 01:26:40 +00:00
| channel | indexURL | Comments | REPL |
| ------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------- |
| Latest release | `{{PYODIDE_CDN_URL}}` | Recommended, cached by the browser | [link ](https://pyodide.org/en/stable/console.html ) |
| Dev (`main` branch) | `https://cdn.jsdelivr.net/pyodide/dev/full/` | Re-deployed for each commit on main, no browser caching, should only be used for testing | [link ](https://pyodide.org/en/latest/console.html ) |
2021-08-11 10:00:44 +00:00
2023-03-29 20:06:59 +00:00
For a given version, several build variants are also available,
- `<version>/full/` : the default full build
- `<version>/debug/` : build with unminified `pyodide.asm.js` useful for debugging
2021-11-14 20:47:49 +00:00
### GitHub releases
2021-08-11 10:00:44 +00:00
2021-11-14 20:47:49 +00:00
You can also download Pyodide packages from [GitHub
2023-01-24 21:11:31 +00:00
releases](https://github.com/pyodide/pyodide/releases). The full distribution
including all vendored packages is available as `pyodide-{{VERSION}}.tar.bz2` .
The full distribution is quite large (200+ megabytes). The minimal set of files
needed to start Pyodide is included as `pyodide-core-{{VERSION}}.tar.bz2` . It is
intended for use with node which will automatically install missing packages
from the cdn -- it is the same set of files that are installed if you use `npm
install pyodide`. It may also be convenient for other purposes.
2022-06-22 03:15:37 +00:00
You will need to serve these files yourself.
2021-08-11 10:00:44 +00:00
2022-01-04 15:46:00 +00:00
(serving_pyodide_packages)=
2021-09-14 07:05:44 +00:00
2021-08-11 10:00:44 +00:00
## Serving Pyodide packages
### Serving locally
2023-01-20 02:21:44 +00:00
With Python 3.7.5+ you can serve Pyodide files locally with {py:mod}`http.server`:
2021-08-11 10:00:44 +00:00
```
python -m http.server
```
2022-06-22 03:15:37 +00:00
from the Pyodide distribution folder. Navigate to
[http://localhost:8000/console.html ](http://localhost:8000/console.html ) and
the Pyodide repl should load.
2021-08-11 10:00:44 +00:00
### Remote deployments
2022-06-22 03:15:37 +00:00
Any service that hosts static files and that correctly sets the WASM MIME type
and CORS headers will work. For instance, you can use GitHub Pages or similar
services.
2021-08-11 10:00:44 +00:00
2022-06-22 03:15:37 +00:00
For additional suggestions for optimizing the size and load time for Pyodide,
see the [Emscripten documentation about
deployments](https://emscripten.org/docs/compiling/Deploying-Pages.html).