-
-
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 'micropip' is included in the Pyodide distribution, but it is not installed. #648
Comments
Hi, I am encountering the same error. Were you able to fix it? |
I encounter the same problem:
|
Sorry for my late reply.
|
The version is 0.47.0, should be the newest
The requirement is just pandas, the same error occurs also, when i try to run 'npm run dump streamlit_app pandas' |
Thank you.
|
I tried deleting the folder and reinstalling several times, with different node/npm versions and with yarn. same behaviour every time. My machine runs windows, on a mac the same project dumped as expected. The log is in the attached .txt. Thank you for the fast answer :) |
This error occurs when you are on a restricted network for instance, on corporate network. This means that cdn.delivry.js is blocked on the network which is preventing the download of micropip and other whl files. To get around it, manually download the pyodide latest release from here (https://github.com/pyodide/pyodide/releases/tag/0.25.0) and extract it in the pyodide folder of node_modules. This would get rid of the error but it might create a new one because we are still on restricted network and there are a lot of dependencies being accessed from various different urls. To know what is actually getting restricted, use stlite mountable and inspect network in browser. This just tells where the issue lies, doesn't fix it. The only way to fix it to get it unblocked or switching to a unrestricted network. I tried hosting the whl pyodide and stlite files for stlite-mountable on localhost which worked and loaded micropip but then it got blocked at tenacity-8.2.3-py3-none-any.whl and six other whl required from https://files.pythonhosted.org. I am not sure how to redirect those requests to my local server. |
DDias I see the same issue as mine in your log.txt |
You are right, I am in a restricted corporate network. Downloading the pyodide folder didn't fix any error for me, but at least I know the reason now. |
You need to extract the contents of the pyodide folder, the one with pyodide.js and move all the individual files into the pyodide folder of node_modules. If pythonhosted url works for you, stlite-mountable should work. P.S. If anyone knows how to redirect requests for tenacity, altair, etc from pythonhosted to a local server please do let me know. |
Thank you both, all makes sense. I will pin the following 2 tasks for future improvements.
|
@DuelistRaj sorry for bothering you again. I did unpack the folder into node_modules and now there is a file named 'node_modules/pyodide/micropip-0.5.0-py3-none-any.whl'. But I still get the error 'Didn't find package micropip-0.5.0-py3-none-any.whl locally, attempting to load from https://cdn.jsdelivr.net/pyodide/v0.24.1/full/'! In my opinion it should find the file now, doesn't it? I just unpacked/copied the files into the project and ran 'npm run dump...' again, is that correct? |
@DDidas I am assuming you downloaded the latest version of pyodide (v0.25). Make sure you have the correct release. Required is v0.24.1 |
A better approach would be to host the pyodide files (make sure to download the release that is required) on a local server and replacing the cdn url in dump_artifacts.js found in node_modules/@stlite/desktop/bin with your localhost url.
|
Since 0.57.0, a new |
I get this error trace while I was trying to build my streamlit project from inside of project package
The project structure was something like this:
I tried both
npm run dump directory_a
and
npm run dump directory_a -- -r requirements.txt
but I took same error on both of them
Thanks in advance.
The text was updated successfully, but these errors were encountered: