johschmitz/blender-driving-scenario-creator

ModuleNotFoundError: No module named 'lib2to3' when enabling the add-on on blender

Closed this issue · 3 comments

Hi, I get the following error when trying to enable the blender-driving-scenario-creator add-on.
Here some remarks for reproducing the error. It would be great if you could help me with this issue.

Operating System Ubuntu 18.04.6 LTS
Step where the problem occurs: Add-on (Linux and Windows)
Blender version: Blender 3.2.2
Notes: I tried installing blender both under /opt and under my home and nothing changed
Printout when trying to enable the add-on:

Read prefs: /home/aaa/.config/blender/3.2/config/userpref.blend
Traceback (most recent call last):
  File "/home/aaa/blender-3/3.2/scripts/modules/addon_utils.py", line 335, in enable
    mod = __import__(module_name)
  File "/home/aaa/.config/blender/3.2/scripts/addons/blender-driving-scenario-creator/__init__.py", line 19, in <module>
    from . export import DSC_OT_export
  File "/home/aaa/.config/blender/3.2/scripts/addons/blender-driving-scenario-creator/export.py", line 17, in <module>
    from scenariogeneration import xosc
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/__init__.py", line 7, in <module>
    from .esmini_runner import *
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/esmini_runner.py", line 15, in <module>
    from .xodr import OpenDrive
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/xodr/__init__.py", line 11, in <module>
    from .signals_objects import *
  File "/home/aaa/blender-3/3.2/python/lib/python3.10/site-packages/scenariogeneration/xodr/signals_objects.py", line 12, in <module>
    from lib2to3.pytree import convert
ModuleNotFoundError: No module named 'lib2to3'

I tried to install it with ./python3.10 -m pip install 2to3 in /home/aaa/blender-3/3.2/python/bin but I didn't notice any improvements.

Thanks

This was a bug in the scenariogeneration library which should be already solved. See pyoscx/scenariogeneration#121
Could you please try installing a newer version of the library in your Blender Python environment and report back if it works again?

I started the process from scratch removing all cached python libs and the blender folder.
The latest scenariogeneration tar.gz doesn't contain your update, in fact it's older.
I'm in blender/3.2/python/bin and I run ./pip3 install --upgrade --force-reinstall scenariogeneration.
Then I opened the file blender/3.2/python/lib/python3.10/site-packages/scenariogeneration/xodr/signals_objects.py and I saw that the from lib2to3.pytree import convert was actually there.
From the file blender/3.2/python/lib/python3.10/site-packages/scenariogeneration-0.9.0.dist-info/METADATA the version is actually the latest on the repo:

Metadata-Version: 2.1
Name: scenariogeneration
Version: 0.9.0
Summary: Generation of OpenSCENARIO and OpenDRIVE xml files
Home-page: https://github.com/pyoscx/scenariogeneration
Author: Mikael Andersson, Irene Natale, Andreas Tingberg
Author-email: andmika@gmail.com
License: MPL-2.0
Download-URL: https://github.com/pyoscx/scenariogeneration/archive/v0.9.0.tar.gz
Keywords: OpenDRIVE,OpenSCENARIO,xml
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pyclothoids

If I remove manually that import, everything works fine.
I will report it to the scenariogeneration repo