[Bf-committers] import error: bpy_types not found on mac osx, blender 2.78 bpy build

Diwale Sanket Sanjay sanket.diwale at epfl.ch
Fri Nov 25 12:53:49 CET 2016

Dear all,

Here is a short description of the import error I am facing when importing the bpy module of blender in an external python3.5.2 environment.

My system configuration is as follows:

**System Information**
Operating system and processor
Mac Osx 10.10.5, 2.8 GHz Intel Core i7
**Blender Version**
Blender 2.78, obtained from master branch of git repository.
** Python version **
I have python3.5.2 installed externally using homebrew which I would like to use outside of blender and import  the bpy module.

The following is what works and doesn’t work for me with the above configuration.

Broken: external python module (bpy) builds fine but does not import without errors on python3.5.2
Worked: blender gui build works fine and the internal console python scripting works fine as well and "import bpy" works there without any errors

It would be helpful if you could shed some light on wether this is a bug with blender 2.78 or some problem at my end. There seem to be more people facing the same error when looking through google searches and forums found with a google search for
“ import error: bpy_types not found” . However couldn’t find a solution to the problem online.

**Short description of error**
I cloned the git repository for blender and built blender as given on https://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Mac
The default build for the gui version of blender works fine and python scripting within the gui console with inbuilt python works fine.

I built the python module bpy for external python imports by running
"make bpy”
 in the blender root folder.
The build completes sucessfully and I get a bpy.so file and other required python scripts and modules in bin folder of the build target directory.
However when executing  import bpy, python throws the following error:
Color management: using fallback mode for management
bpy: couldnt find 'scripts/modules', blender probably wont start.
Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.
ImportError: No module named ‘bpy_types'
ImportError: No module named ‘bpy_types'
pyrna_srna_ExternalType: failed to find 'bpy_types’ module
ImportError: No module named ‘bpy_types'
ImportError: No module named ‘bpy_types'
pyrna_srna_ExternalType: failed to find 'bpy_types’ module
ImportError: No module named ‘bpy_types'
pyrna_srna_ExternalType: failed to find 'bpy_types’ module
F1124 12:38:34.330813 2035057408 utilities.cc<http://utilities.cc/>:322] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!
*** Check failure stack trace: ***
    @        0x110f0f941
    @        0x110f13962
Abort trap: 6


**Exact steps for others to reproduce the error**

mkdir ~/blender-build
cd ~/blender-build
git clone http://git.blender.org<http://git.blender.org/>/blender.git
cd blender
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master

cd ~/blender-build/blender
make bpy

Then go to the build bin directory which should now contain bpy.so file and other dependencies.
cd ../build_darwin_bpy/bin/
Then start python3 as: python3 and import bpy
>> import bpy

This gives out the error as mentioned above.


More information about the Bf-committers mailing list