Python Scripting Box : Error : No module named numpy

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
deejay6
Posts: 6
Joined: Thu Mar 09, 2017 9:38 pm

Python Scripting Box : Error : No module named numpy

Post by deejay6 »

I am trying to run the basic examples that come with openvibe like Signal Average.py etc codes within Python Scripting boxes, It gives a error no module named Numpy even though numpy is installed, I installed canopy, also installed numpy using pip, and in the command prompt it all works as importing numpy.

Here are the specs :Windows 7 32 bit, Python 2.7.( i had to downgrade to a all this to even get hello world scripting box work)

Any help is greatly appreciated.

Thanks
DJ

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Python Scripting Box : Error : No module named numpy

Post by jtlindgren »

Hi DJ,

hard to say for sure what could be the problem. Have you checked that everything is set up according to the OpenViBE python tutorial?

I jush tried the box with ov 1.3.0, Python 2.7.11 32bit, numpy 1.12.1, Windows10 64bit, and it works ok (sinus oscillator tutorial relies on numpy). I don't have Anaconda or any other such distro, just vanilla python with numpy put in by pip.

Speculation: perhaps you have a problem from multiple python installations on the same machine. You should make sure all python related stuff (in registry, and env variables PATH, PYTHONHOME, PYTHONPATH) point to the 2.7 series of python.


Cheers,
Jussi

deejay6
Posts: 6
Joined: Thu Mar 09, 2017 9:38 pm

Re: Python Scripting Box : Error : No module named numpy

Post by deejay6 »

Thanks for your response Jussi !

Now I uninstalled Python 2.7.3 and installed 2.7.11 and everything exactly as your settings on win 10 64bit etc. Also installed numpy using pip.
Now the python box also dissapeaerd from scripting.

Could you help how would I go about changing/cleaning the registries/ PATH ( I have added Python27 to the Env variables).

Thanks.

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Python Scripting Box : Error : No module named numpy

Post by jtlindgren »

If the python box disappears, you should have some printout in the console (the black window, not the graphical user interface one). What does it say? I assume you're not building openvibe yourself.

Unfortunately if its really about conflicting versions of python, cleaning up python installations is unfortunately outside my competence and more a question to the python community. I'd google for it if I were you. :)


Cheers,
Jussi

deejay6
Posts: 6
Joined: Thu Mar 09, 2017 9:38 pm

Re: Python Scripting Box : Error : No module named numpy

Post by deejay6 »

Thank you so much. I got it to work using older computer with Windows 7.

jtlindgren
Posts: 775
Joined: Tue Dec 04, 2012 3:53 pm
Location: INRIA Rennes, FRANCE

Re: Python Scripting Box : Error : No module named numpy

Post by jtlindgren »

Hi Deejay, good to hear. Was there anything particular to do? The solution might help others if they run into the same problem.

Thanks,
Jussi

deejay6
Posts: 6
Joined: Thu Mar 09, 2017 9:38 pm

Re: Python Scripting Box : Error : No module named numpy

Post by deejay6 »

I think I deleted registry and reinstalled python 2.7.11 instead of what I had 2.7.3.

m.casso-echalar
Posts: 21
Joined: Tue Jun 02, 2020 3:07 pm

Re: Python Scripting Box : Error : No module named numpy

Post by m.casso-echalar »

Hello,
I am having the same issue with Openvibe v. 3.1.0 and python 3.7.8.
In my script, I am also working with the pygame library so I'm not sure how the NumPy library has this issue.

Code: Select all

[ ERROR ] At time 0.000 sec <Box algorithm::(0x00003ff3, 0x00002dd4) aka Python 3 scripting> Failed to run [C:/Users/Public/Documents/openvibe-3.1.0-64bit/pygametest.py], result = -1
[  INF  ] At time 0.000 sec <Box algorithm::(0x00003ff3, 0x00002dd4) aka Python 3 scripting> executing script file
pygame 2.0.1 (SDL 2.0.14, Python 3.7.8)
Hello from the pygame community. https://www.pygame.org/contribute.html
error
Traceback (most recent call last):
  File "<string>", line 31, in execfileHandlingException
  File "C:/Users/Public/Documents/openvibe-3.1.0-64bit/pygametest.py", line 9, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'
Does someone know what could be the issue? Thank you in advance!
Last edited by m.casso-echalar on Tue May 25, 2021 7:42 am, edited 2 times in total.

Thomas
Posts: 210
Joined: Wed Mar 04, 2020 3:38 pm

Re: Python Scripting Box : Error : No module named numpy

Post by Thomas »

Hi,

The pygametest.py script is trying to import numpy, but it is not part of your python installation... yet!

To install it, you need to run the following command in a terminal: pip3.7.exe install numpy.

For info, the executable pip3.7.exe is located in your python install folder, under the Scripts folder.

If you get other errors of the kind "no module name...", repeat this operation for the missing modules.

Hope this helps,
Thomas

m.casso-echalar
Posts: 21
Joined: Tue Jun 02, 2020 3:07 pm

Re: Python Scripting Box : Error : No module named numpy

Post by m.casso-echalar »

Hello,
it worked thank you for your time and help!

Post Reply