ModuleNotFoundError for numpy

Hello, I’m trying to use numpy library but always have this error: ModuleNotFoundError: No module named ‘numpy’

I have the educative licence

Are you trying to import numpy on the client side or server side? What python version do you have in the settings? If its is the Beta, which version of the Beta did you select and did you install numpy?

2 Likes

You need to install the module in the Server side you can’t import any module through the website.

Thanks, but how do I install the module ‘numpy’ or other modules in the server side, and do I use the library in the client’s code?

Im trying to import in the client side - I have Full Python 3 in the settings - Im working with the Beta editor

If you’re using the beta:

If you’re not using the beta, you dont need to. It’s already installed.

Either way you cannot use the package on the client side. Only libraries implemented by skulpt are accessible on the client side. But what you can do is write a server function to process data you pass it and then return that processed data to the client.

Here is a doc explaining :

No. Third-party libraries such as numpy cannot be imported directly into the Client, and so cannot be called directly from the Client.

But “directly” is not the only option. The Client can call Server-side code, which in turn can import and call numpy, on the Client’s behalf.

That describes the Server-side implementation of Python.
image
“Sever Code” should probably be part of the heading in bold, to avoid this confusion.

If you click on “Advanced settings…” you will see something like the following:
image