3
$\begingroup$

This question already has an answer here:

I hit Shift+F4 to get the Blender Python console.

   PYTHON INTERACTIVE CONSOLE 3.2.3 (default, Sep 25 2013, 19:38:45)  [GCC 4.7.2]

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

On the web, I found some instructions that might work, that involved copying my Python3 numpy into the Blender Folder. http://blenderartists.org/forum/showthread.php?217270-How-to-install-numpy

  1. Install python3.2
  2. Install numpy for python3.2 using the python3.2 command instead of python
  3. on my system numpy was located in /usr/local/lib/python3.2/dist-packages. Copy numpy from there to blender/2.57/scripts/modules

Looking around and with help from StackOverflow In my case, copied numPy to /usr/lib/blender/modules however it still cannot find.

I may have done some of these steps wrong or not represented them accurately. This is to the best of my memory.

$\endgroup$

marked as duplicate by ideasman42 Dec 23 '13 at 6:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Are you using blender 2.57? If you are not, try copying it to blender/$version/scripts/modules instead. $\endgroup$ – gandalf3 Dec 23 '13 at 3:02
  • $\begingroup$ While you need to get the blender version right you also want to use a matching python version. python 3.2 was used up until blender 2.64 - I expect you have a blender version higher than 2.64 so you will want to use a python 3.3 module. $\endgroup$ – sambler Dec 23 '13 at 3:19
  • 2
    $\begingroup$ I noticed in your other question that you are using 2.63 you may want to install a newer version as 2.63 is 19 months old and there has been a lot of python changes since 2.63 so you may find it hard to get help writing python for the older versions - the current release is 2.69 $\endgroup$ – sambler Dec 23 '13 at 3:31
  • $\begingroup$ @sambler I got the most current Python and Blender I could find. Now I can run my numpy script finally. $\endgroup$ – john mangual Dec 23 '13 at 6:13
  • $\begingroup$ @johnmangual Have a read of Where can I get Blender test builds $\endgroup$ – sambler Dec 23 '13 at 7:40
1
$\begingroup$

You need to copy the numpy installation (or any other Python package) into:

..\Blender\2.69\python\lib\site-packages\

it works with no problem.


Practice: go to the above directory and create a sub-directory these. Go inside these and create a empty file __init__.py.

In Python console inside Blender now if you type: import these it works like a charm. This is the same story for any other package.

$\endgroup$
0
$\begingroup$

@Sambler

I installed Python 3.3 with sudo apt-get install python3.3

Then I installed pip from http://www.pip-installer.org/en/latest/installing.html calling python3.3 instead of python. This required getting python3.3-dev with apt-get

Installing numPy was straightforward after this pip-3.3 install numpy

Finally I installed blender from http://www.blender.org/download/ and unzip with tar jxvf blender-2.69-linux-glibc211-x86_64.tar.bz2 and now it runs with ./blender

I added this line to ~/.bashrc: export PATH="/path/to/blender:$PATH"

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.