-
Notifications
You must be signed in to change notification settings - Fork 0
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
requests #22
Comments
The only package I need, working with plain |
Even changing the order of imports (and explicitly putting
results in the following error
|
Sorry requests is a synchronous module, at this time it will never work with pygbag ( only maybe later with pyodide when wasm will support js promises but that won't be until pygbag 2.x ). Meanwhile either find an asynchronous implementation of requests, or write your own upon browser fetch api, as pyodide/pyscript has actually quite same behaviour you can look there to find guidance. |
Where can I look to find guidance? What's the issue with synchronous modules in pygbag? Could you provide some hint to better investigate this issue please? |
All files/network io and time.sleep are synchronous in standard python interpreter, but wasm engine don't allow for wasm programs to pause and resume when needed. To fix that is outside python/emscripten scope see https://webassembly.org/ instead. |
I would like to make couple of API requests from my videogame written with pygame and pygbag, thus using the
requests
module.After having added the neccessary import and the wheel in my own CDN I moved forward, but I still get different errors.
Once the
requests
module was available, it was looking for theurllib3
one. Once I put in place this one too, he is now screaming for thehmac
one. I cannot find a wheel for thehmac
since this should be automatically shipped with anypython
installation.The error is here below, any suggestion on how to proceed? Even a brief explanation of how all this stuff works in WASM and how transitive/nested dependecies are managed would be helpful.
The text was updated successfully, but these errors were encountered: