Based on these instructions :
Get the source code of the blender:
cd ~/src
Take care of the dependencies, see, for example, here if necessary * and compile using the bpy target:
cd ~/src/blender make bpy
(re) run the latter as root if errors like file INSTALL cannot set permissions on [...]
Your python 3 should now be able to import bpy .
* For Debian-ish systems
sudo apt-get install subversion build-essential gettext \ libxi-dev libsndfile1-dev \ libpng12-dev libjpeg-dev libfftw3-dev \ libopenexr-dev libopenjpeg-dev \ libopenal-dev libalut-dev libvorbis-dev \ libglu1-mesa-dev libsdl1.2-dev libfreetype6-dev \ libtiff4-dev libavdevice-dev \ libavformat-dev libavutil-dev libavcodec-dev libjack-dev \ libswscale-dev libx264-dev libmp3lame-dev python3.2-dev \ libspnav-dev libtheora-dev libjack-dev libglew1.6-dev
Tobias Kienzler
source share