Sorry, not sure if this even qualifies as a bug. The way blender ist started at the moment it's python interpreter doesn't find any of the external installed python modules. A "help ("modules")" doesn't show them. The problem is that "/usr/lib64/blender3.2/site-packages" is not in the search path for modules in blender: >>> import sys >>> print (sys.path) ['/usr/share/blender/2.5/scripts/addons', '/usr/share/blender/2.5/scripts/startup', '/usr/share/blender/2.5/scripts/modules', '/usr/lib64/python32.zip', '/usr/lib64/python3.2/', '/usr/lib64/python3.2/plat-linux2', '/usr/lib64/python3.2/lib-dynload', '/usr/share/blender/2.5/scripts/addons/modules'] The problem can be easily fixed within blender with a "sys.path.append("/usr/lib64/python3.2/site-packages")" but I think adding "export PYTHONPATH="/usr/lib64/python3.2/site-packages"" to the /usr/bin/blender-2.5 start script is a better solution. Reproducible: Always Steps to Reproduce: 1. start Blender 2. Go the the Blender python console 3. try a "import lxml" (in case dev-python/lxml is actually installed..should work with any other python package also) Actual Results: >>> import lxml Traceback (most recent call last): File "<blender_console>", line 1, in <module> ImportError: No module named lxml Expected Results: importing of external modules work in blender-python
This looks more like a python-updater problem. Did you run it after installing python:3.2 ?
yep..even had a complete --emptytree rebuild afterwards. Oh..and I forgot to mention..when I start "python3.2" from the shell and do a "help ("modules")" there I have access to all external modules. It just doesn't work in blender. And to add some more information..in eselect python 2.7 is the active python installation....but tried to temporary select 3.2 there with no change.
This is a common issue across platforms (I've bumped into it on Gentoo and on Mac OSX). It stems from the fact that Blender 2.5x bundles it's own Python 3.2 packaged with its modules. My workaround is to create the following alias in ~/.bashrc: alias blender='PYTHONPATH="/usr/lib64/python3.2/site-packages/:${PYTHONPATH}" blender-2.5' You can also modify the ebuild to build against the system python 3.2 installation by following this guide: http://wiki.blender.org/index.php/Dev:2.5/Doc/Building_Blender/Linux/Troubleshooting
Created attachment 291909 [details, diff] temp quick & dirty patch
assigned to python team, this one sitting untouched for 5 months. The ebuild needs cleaning up, commented out code everywhere. You'll find me in irc to polish
Overwriting of /etc/bash/bashrc in pkg_postinst() is definitely unacceptable.
Created attachment 291911 [details, diff] blender-2.57-enable_site_module.patch Value of sys.path from comment #0 suggests that site module is not imported. Please test this patch.
re-assigning to lu_zero as that is the maintainer listed in metadata.xml for this package.
This seems to work now in blender-2.60a. I could import lxml without any problems and I get all installed python modules shown with "help ("modules"). Sorry, couldn't test those patches for 2.57 easily as I ran into bug 380989 when trying to compile that version. But with 2.60a all seems fine now...Thanks a lot.
07 Nov 2011; Luca Barbato <lu_zero@gentoo.org> blender-2.57-r1.ebuild, +files/blender-2.57-enable_site_module.patch, files/blender-2.57-libav-0.7.patch: Update ebuild to fix #369931 and #374339