-
Notifications
You must be signed in to change notification settings - Fork 147
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
Installing Packages for predicted_output_choices #482
Comments
How exactly did you install numpy? I think there is a specific way in which packages are installed int pyodide |
Hello,
thank you for your quick response!
I need to install numpy, since I can not run the generate.sh file without installing numpy. I used poetry install.
[cid:d109f0b6-106b-4e58-b466-9b28f58fd33f]
This is where the mistake occurs if numpy is not installed. But after installing numpy with poetry install I can not import numpy in the console at futurecoder homepage.
Thank you!!!
Best regards
Hannah Knehr
…________________________________
Von: oskarissimus ***@***.***>
Gesendet: Montag, 2. September 2024 13:41
An: alexmojaki/futurecoder ***@***.***>
Cc: HannahKn123 ***@***.***>; Author ***@***.***>
Betreff: Re: [alexmojaki/futurecoder] Installing Packages for predicted_output_choices (Issue #482)
How exactly did you install numpy? I think there is a specific way in which packages are installed int pyodide
https://pyodide.org/en/stable/usage/loading-packages.html
—
Reply to this email directly, view it on GitHub<#482 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BAA3CHEN7Z2YBHUSGIEYY3DZURFGVAVCNFSM6AAAAABNQD2FY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRUGU2DAMJWGE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I think that installing numpy with poetry won't be enough. Pyodide - the thing that makes python work in browser - has its own packages. See the example below on how dependences are added to pyodide futurecoder/frontend/src/Worker.js Line 40 in 9198eb2
I might be wrong tho |
It's true that you need to load numpy specially within pyodide. Try adding futurecoder/frontend/src/Worker.js Lines 14 to 18 in 9198eb2
But you do also need to install it with poetry and import it to generate static files. And this is the first time that there's a dependency that isn't pure Python and has to be loaded differently in the two environments. Ensure futurecoder/scripts/generate_static_files.py Lines 69 to 72 in 9198eb2
This will prevent it from being added to |
Hello,
I am experimenting with the code and would like to create a quiz with predicted_output_choices. Part of the quiz should be to initialize a numpy array and the choices should be 4 different arrays a a output.
For this I have to install numpy in the backend. Unfortunately there are problems if I install numpy in the back end, because then I can't install numpy directly in the futurecoder. The following error message appears:
Error traceback:
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
A ModuleNotFoundError exception indicates that you are trying to import a module that cannot be found by Python. This could be because you misspelled the name of the module or because it is not installed on your computer.
No module named numpy.core._multiarray_umath can be imported. Perhaps you need to install it.
Click to expand
During handling of the above exception, another exception occurred:
1 import numpy as np
ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed. We have compiled some common reasons and troubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: * The Python version is: Python3.11 from "/home/pyodide/this.program" * The NumPy version is: "1.24.2" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: No module named 'numpy.core._multiarray_umath'
Does anyone have an idea how I can work around this problem?
Thank you!
The text was updated successfully, but these errors were encountered: