Numpy in blender: having a lot of difficulty

I’m having a lot of difficulty getting numpy to work in blender. I’m running ubuntu 14.04 and Blender 2.77. I’ve already tried moving the numpy folder into blender/2.77/scripts/modules. No luck. I’ve included a screenshot of what I get when I try to import numpy in the python interpreter within blender. Numpy works fine outside of blender. Anyone know how to fix this?

Attachments


I tried this:

import numpy
from numpy.core import multiarray

f = multiarray.array([1,1,1,1])
print(f)

and it works fine.

It’s working out of the box. No need to download numpy separately and paste somewhere.

Works for me without issue. Please share your numpy version and/or maybe show us your “pip list”


PYTHON INTERACTIVE CONSOLE 3.5.1 (default, Feb 17 2016, 15:11:27)  [GCC 4.7.1]


Command History:     Up/Down Arrow
Cursor:              Left/Right Home/End
Remove:              Backspace/Delete
Execute:             Enter
Autocomplete:        Ctrl-Space
Zoom:                Ctrl +/-, Ctrl-Wheel
Builtin Modules:     bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils
Convenience Imports: from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data


>>> import numpy
>>> from numpy.core import multiarray
>>> f = multiarray.array([1,1,1,1])
>>> print(f)
[1 1 1 1]


>>> print(numpy.__version__)
1.10.1


>>> 

Attachments


I’m having a similar problem as the original poster. Using Debian and blender out of the box, numpy doesn’t work. Debian reports that I have the “python-numpy” package installed, version 1:1.12.0-2. But here’s what I see in the blender python console:

PYTHON INTERACTIVE CONSOLE 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170118]

Command History: Up/Down Arrow
Cursor: Left/Right Home/End
Remove: Backspace/Delete
Execute: Enter
Autocomplete: Ctrl-Space
Zoom: Ctrl +/-, Ctrl-Wheel
Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils
Convenience Imports: from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data

>>> import numpy
Traceback (most recent call last):
File “<blender_console>”, line 1, in <module>
ImportError: No module named ‘numpy’

>>>

on win I got 1.9.1 ! with 2.78 official version
how come you got a higher version ?

happy bl