Can't get numpy to work

I’m trying to learn reinforcement learning & all the tutorials I found so far use a program called numpy or something called numpy. I’ve downloaded it & unzipped it, but still get there no module named numpy. Can someone help me fix the problem or point to some stuff that don’t use it

1 Like
2 Likes

guess i’m not using it. time to find a place that don’t use it. Any advice?

1 Like

This is the main tutorial page about Processing’s Python Mode (Jython-based) flavor: :snake:
Py.Processing.org/tutorials/

For the original C-based Python, go here: :wink:

2 Likes

I don’t see reinforcement learning in those tutorials

1 Like

I dunno what kinda tutorials are those. But I bet they require the original Python. :thinking:

2 Likes

Thonny is a quick and easy way to get Python set up and running. It comes bundled with an editor and Python. You can install numpy from the Thonny package manager (Tools > Manage Packages).

2 Likes

ty I got python on my computer just trying to learn how to do reinforcement learning and every dumb tutorial says use python & a bunch of libraries

1 Like

You can add Python packages using pip. You might need to install it first, then open your command-line/terminal and type:

pip install numpy

IDEs like Thonny and PyCharm include package managers that handle this process for you.

3 Likes

I really starting to hate how you need hundred libraries to do one simple thing

1 Like

Python works with numpy.

Processing.py does not and will not work with numpy. For why, see:

Does this mean I can use SciPy!? NumPy!?

No. Processing’s Python Mode is implemented in Java, and relies on the Jython project’s implementation of the Python programming language. You can use any “pure Python” module, meaning any Python

1 Like

I would recommend using Anaconda with all machine learning related activities. Installing python with it installs numpy, pandas, scikit-learn etc. libraries used with machine learning. You might need to install Tensorflow and Keras to do Deep Learning based transfer learning, but that too can be done by Anaconda.

4 Likes

If you want to use Processing visualization with python3, check out p5py.

Note it does not interface with Java libraries.

1 Like

I got it working. Then the tutorial I was watching switched from reinforcement learning to supervised learning.

are you get Numpy working with processing.py mode? how

It won’t work @doni, because Processing.py uses Jython:
https://py.processing.org/tutorials/python-jython-java/

I don’t know what you’d like to accomplish. If you explain, we might suggest an alternative approach. You could try py5 instead of Processing.py.

1 Like

hi. i am sorry for late reply. before i want to build raspberry pi lane detection with processing editor. but now i want to try change to use opencv in android mode (android phone as machine). so would you like to suggest what processing library have same function as numPy. thank you

If you have to deal with vectors and matrices in Processing Python mode, mpmath can be an option. It has some handy methods that are reminiscent of Numpy’s although they are significantly slower (pure Python, no vectorized operations).

See doc here.

Other than that, I remember using EJML without trouble in Python mode.

2 Likes

thank you brother will try your suggestion