linux - missing lib2to3 python module

Hi all, i’ve recently discovered that linux distributions of blender doesn’t ship a complete python environment, in particular is missing lib2to3 python module. Since this module is a dependency for a dependency of my add-on it won’t work without it. Morover there is no way to install it trought pip. Any suggestion apart rely on system python distribution??

bump :cool:

What is the full name of the module? I’m on Arch, and even in AUR I can’t find anything lib2to3.

thanks for the reply! however this is the path of windows distribution of blender:
blender\2.78\python\lib\lib2to3

the path for linux distribution is different:
blender-linux\2.78\python\lib\python3.5\

but here there is no lib2to3

and seems also there are lot of other missing modules.

however to test it out just type “import lib2to3” in blender python console, and in linux distribution of blender you should get an error"

Nope, no error (tested using a built in template). Not much help, I know, but should eliminate Linux per se as the problem.

did you use the apt-get version of blender or the tar downloaded from blender.org?? because the apt-get version of blender “import lib2to3” work… but the one downloaded from blender.org doesn’t:


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

don’t know if previous version are shipped with it, but actually the 2.78b no. I’ve just tried it right now on VBox

Yup, I get the same error with the tar 2.78b downloaded from blender.org

that is weird, because i’m using TravisCI for my add-on and i’m not able to test it properly on blender because is missing this lib…

but the add-on works fine, what I have tested right now.

nope, look


Traceback (most recent call last):
  File "/media/sf_projects/python/blender-linux/2.78/scripts/modules/addon_utils.py", line 330, in enable
    mod = __import__(module_name)
  File "/media/sf_projects/python/blender-linux/2.78/scripts/addons/uv_align_distribute/__init__.py", line 45, in <module>
    from . import match_islands
  File "/media/sf_projects/python/blender-linux/2.78/scripts/addons/uv_align_distribute/match_islands.py", line 34, in <module>
    import networkx
  File "/media/sf_projects/python/blender-linux/2.78/scripts/addons/uv_align_distribute/networkx/networkx/__init__.py", line 87, in <module>
    import networkx.readwrite
  File "/media/sf_projects/python/blender-linux/2.78/scripts/addons/uv_align_distribute/networkx/networkx/readwrite/__init__.py", line 14, in <module>
    from networkx.readwrite.gml import *
  File "/media/sf_projects/python/blender-linux/2.78/scripts/addons/uv_align_distribute/networkx/networkx/readwrite/gml.py", line 44, in <module>
    from lib2to3.pgen2.parse import ParseError
ImportError: No module named 'lib2to3'

It doesn’t even get enabled…

hmm,maybe this helps you:
https://wiki.blender.org/index.php/Dev:2.5/Source/Python/API/Py3.1_Migration
What I understand is that the lib2to3 is bundled in the .so files on linux, so maybe try blender-2.78b/lib

if i understand correctly you suggest to change the import statement?? the problem is that i don’t directly import this module, but is a dependency that require it, so i prefer to don’t change it(it’s already painful to bundle the dep module instead of let blender install it).

Sorry, can´t help you, maybe ask at blender.stackexchange.com

Or in IRC, #blenderpython , #blendercoders

https://wiki.blender.org/index.php/Community:Chat

You were right, now I get the same error in blender 2.78b.I can´t get it enabled.

On another version, it worked without errors though.
version: 2.77 (sub 3), branch: master, commit date: 2016-08-11 10:36, hash: 1fe9d67, type: Release
build date: 2016-08-11, 17:01:25