2020-07-14 09:29:58 +00:00
|
|
|
# Frequently Asked Questions (FAQ)
|
|
|
|
|
2020-10-30 20:09:25 +00:00
|
|
|
## How can I load external python files in Pyodide?
|
2020-07-14 09:29:58 +00:00
|
|
|
|
|
|
|
The two possible solutions are,
|
|
|
|
|
|
|
|
- include these files in a python package, build a pure python wheel with
|
2020-10-30 20:09:25 +00:00
|
|
|
`python setup.py bdist_wheel` and
|
|
|
|
{ref}`load it with micropip <micropip-installing-from-arbitrary-urls>`.
|
2020-07-14 09:29:58 +00:00
|
|
|
- fetch the python code as a string and evaluate it in Python,
|
|
|
|
```js
|
|
|
|
pyodide.eval_code(pyodide.open_url('https://some_url/...'))
|
|
|
|
```
|
|
|
|
|
|
|
|
In both cases, files need to be served with a web server and cannot be loaded from local file system.
|
|
|
|
|
2020-10-30 20:09:25 +00:00
|
|
|
## Why can't I load files from the local file system?
|
2020-07-14 09:29:58 +00:00
|
|
|
|
|
|
|
For security reasons JavaScript in the browser is not allowed to load local
|
|
|
|
data files. You need to serve them with a web-browser.
|