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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to integrate in a React Native app? #2343
Comments
Any news on this? I am no expert but it seems it should be possible somehow and only in need of some documentation. |
Well, none of the maintainers use React Native as far as I know. So we are certainly interested if feedback and contributions on this subject but can't answer your question about how to integrate with React Native. Also see the related issue in #2549 There is currently work on improving the npm package discussed in #2403 |
Many thanks! |
Any further news on this? All my attempt to import pyodide failed in the call to I switched to React Native -> chaquopy for now, but if there is anything that worth a test with the React Native -> Pyodide thing please let me know. |
Can you share the detailed error message? Normally the package on NPM should have everything needed for a base setup, and then it would download packages on runtime but it's possible that something would need to be adjusted for this use case. |
Error message:
Sample code to setup the environment:
Modify the App.tsx by adding the following two lines at the top: import {loadPython} from 'pyodide';
loadPython(); Then run the app with the following:
and press a to start Android. I have tried to webpack build and import the webpack one, and it is still the same error message. I am also not using react-py as it requires Worker but Worker is not available by default and it complicates things more. |
@StephDC you could attempt to use a much older version of react-py before web workers were implemented. I think I don't have the capacity to test this now, but if you have any luck with this direction please open a feature request on the react-py repo to optionally disable web workers. |
馃摎 Documentation
It would be great to have some documentation on how to initialize and run Pyodide on mobile devices using React Native. I've tried several methods, but none seems to work satisfactorily. With Tensorflow for React Native being a thing, RN is probably the closest platform to being "ready" for data science on mobile. Thanks!
The text was updated successfully, but these errors were encountered: