You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Can't import file via pyscript_config.toml using [files], ModuleNotFoundError #1869
I'm trying to configure pyscript-react using a pyscript_config.toml file which imports a python library file (geometry_generator.py) using [files]. It seems to load the config file but when I try to import from geometry_generator I get "ModuleNotFoundError: No module named 'geometry_generator'"
I have tried every different combination of file location and paths I can think of but I have not been able to load the geometry_generator file successfully. Currently it's located in public.
Below is the contents of my pyscript_config.toml file:
[pyexec] Python exception:
Traceback (most recent call last):
File "/home/pyodide/pyscript/_internal.py", line 104, in run_pyscript
result = eval_code(code, globals=__main__.__dict__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lib/python311.zip/_pyodide/_base.py", line 468, in eval_code
.run(globals, locals)
^^^^^^^^^^^^^^^^^^^^
File "/lib/python311.zip/_pyodide/_base.py", line 310, in run
coroutine = eval(self.code, globals, locals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<exec>", line 1, in<module>
ModuleNotFoundError: No module named 'geometry_generator'
app-index.tsx:25:19
error app-index.tsx:25
error hydration-error-info.ts:72
fn logger.ts:50
displayPyException pyexec.ts:64
pyExec pyexec.ts:36
init pyscript.ts:37
connectedCallback pyscript.ts:81
executeScripts main.ts:430
afterInterpreterLoad main.ts:279
loadInterpreter main.ts:254
_realMain main.ts:142
main main.ts:105
pyscript main.ts:457
<anonymous> pyscript.js:29204
How to reproduce?
Create Next.js project (using TypeScript), install pyscript-react and its dependencies, create a pyscript_config.toml file and include a python library file using [files] in the config file and try to import from that python library file in the python script within PyScript tags
Activity