-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFoundError: The module 'protobuf' is included in the Pyodide distribution, but it is not installed. #831
Comments
@whitphx Would appreciate your insight in this issue. |
|
./build The package.json
Yes |
Hey! @whitphx what do you think of this. |
Thank you, I could reproduce the error. |
A quick workaround is to add As a dev note, the cause of this error is Pyodide's |
Resolved by #934. |
I get this error trace inside the electron app when I run the dmg created by either npm run dist or yarn dist.
But before this npm run serve or yarn serve for preview does not result in this and the electron app runs fine.
Error during booting up
Traceback (most recent call last):
File "/lib/python311.zip/_pyodide/_base.py", line 573, in eval_code_async
await CodeRunner(
File "/lib/python311.zip/_pyodide/_base.py", line 393, in run_async
coroutine = eval(self.code, globals, locals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 2, in
File "streamlit/init.py", line 69, in
File "streamlit/delta_generator.py", line 35, in
File "streamlit/cursor.py", line 20, in
File "streamlit/runtime/init.py", line 17, in
File "streamlit/runtime/runtime.py", line 26, in
File "streamlit/proto/BackMsg_pb2.py", line 5, in
ModuleNotFoundError: The module 'protobuf' is included in the Pyodide distribution, but it is not installed.
You can install it by calling:
await micropip.install("protobuf") in Python, or
await pyodide.loadPackage("protobuf") in JavaScript
See https://pyodide.org/en/stable/usage/loading-packages.html for more details.
And in the pop-up window in the electron app:
A JavaScript error occurred in the main process
Uncaught Exception:
PythonError: Traceback (most recent call last):
File "/lib/python311.zip/_pyodide/_base.py", line 573, in eval_code_async
await CodeRunner(
File "/lib/python311.zip/_pyodide/_base.py", line 393, in run_async
coroutine = eval(self.code, globals, locals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 2, in
File "streamlit/init.py", line 69, in
File "streamlit/delta_generator.py", line 35, in
File "streamlit/cursor.py", line 20, in
File "streamlit/runtime/init.py", line 17, in
File "streamlit/runtime/runtime.py", line 26, in
File "streamlit/proto/BackMsg_pb2.py", line 5, in
ModuleNotFoundError: The module 'protobuf' is included in the Pyodide distribution, but it is not installed.
You can install it by calling:
await micropip.install("protobuf") in Python, or
await pyodide.loadPackage("protobuf") in JavaScript
See https://pyodide.org/en/stable/usage/loading-packages.html for more details.
at new_error (/Applications/TestApp.app/Contents/Resources/app.asar/build/pyodide/pyodide.asm.js:9:10014)
at wasm://wasm/02257296:wasm-function[300]:0x158e62
at wasm://wasm/02257296:wasm-function[454]:0x15ff9e
at _PyEM_TrampolineCall_JS (/Applications/TestApp.app/Contents/Resources/app.asar/build/pyodide/pyodide.asm.js:9:120223)
at wasm://wasm/02257296:wasm-function[1083]:0x1a3494
at wasm://wasm/02257296:wasm-function[3413]:0x28a2bd
at wasm://wasm/02257296:wasm-function[2063]:0x1e431e
at wasm://wasm/02257296:wasm-function[1090]:0x1a397d
at wasm://wasm/02257296:wasm-function[1093]:0x1a3c3e
at wasm://wasm/02257296:wasm-function[1094]:0x1a3ce0
at wasm://wasm/02257296:wasm-function[3226]:0x2689a4
at wasm://wasm/02257296:wasm-function[3227]:0x26e800
at wasm://wasm/02257296:wasm-function[1096]:0x1a3e08
at wasm://wasm/02257296:wasm-function[1091]:0x1a3a98
at wasm://wasm/02257296:wasm-function[442]:0x15f76b
at Module.callPyObjectKwargs (/Applications/TestApp.app/Contents/Resources/app.asar/build/pyodide/pyodide.asm.js:9:64297)
at Module.callPyObject (/Applications/TestApp.app/Contents/Resources/app.asar/build/pyodide/pyodide.asm.js:9:65365)
at Timeout.wrapper [as _onTimeout] (/Applications/TestApp.app/Contents/Resources/app.asar/build/pyodide/pyodide.asm.js:9:32855)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)
Im running it on Mac 11.6
node -v && npm -v && yarn -v
v18.14.0
9.3.1
1.22.22.
devDependencies": {
"@stlite/desktop": "^0.51.0",
"cross-env": "^7.0.3",
"electron": "^28.2.1",
"electron-builder": "^24.9.1"
My project directory contains:
build
dist
node_modules
package.json
requirements.txt
streamlit_app -> streamlit_app.py
yarn.lock
I can see that, /node_modules/pyodide/protobuf-4.23.1-cp311-cp311-emscripten_3_1_46_wasm32.whl is present.
The requirements.txt contains:
st_files_connection
PyYAML
streamlit-tags
Also my package.json is modified for local file access (which I have modified by running the dump again)
{
// ...other fields...
"stlite": {
"desktop": {
"nodeJsWorker": true,
"nodefsMountpoints": {
"/mnt": "/Users/Shared/Appfiles/"
}
}
}
}
I there is no straight up permanent solution, if someone could suggest a hacky way to package it for now, as npm run serve or yarn serve for preview does not result in this error and the electron app works perfectly well with local directory access as desired, thats why I think its different from #648
The text was updated successfully, but these errors were encountered: