Error when run the script install_requirements.py. + Blender 3.3.21 + python 3.10
Describe the bug When I install this add-on in the blender 3.3.21 (python 3.10), I run the script install_requirements.py as described in https://github.com/dfki-ric/phobos?tab=readme-ov-file#blender, it got the following error:
You are executing this file with: /opt/blender-3.3.21-linux-x64/3.3/python/bin/python3.10 To install the requirements for the installation of the Phobos Blender-Add-on run this file with Blender's python: ${YOUR_BLENDER_EXECUTABLE} -b --python install_requirements.py This script will try to install and update pip and the following python packages. Required: ['pyyaml', 'numpy', 'scipy', 'setuptools', 'pycollada', 'pydot'] Optional: ['lxml', 'networkx', 'trimesh', 'Pillow', 'pybullet', 'open3d', 'python-fcl'] Do you want to proceed? [y/n]>y Checking requirements: Looking in links: /tmp/tmpi6c7xref Requirement already satisfied: setuptools in /home/wghou/.local/lib/python3.10/site-packages (65.5.0) Requirement already satisfied: pip in /home/wghou/.local/lib/python3.10/site-packages (24.3.1) Upgrading pip... Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: pip in /home/wghou/.local/lib/python3.10/site-packages (24.3.1) Checking yaml /opt/blender-3.3.21-linux-x64/3.3/python/bin/install_requirements.py:80: DeprecationWarning: Deprecated since Python 3.4 and slated for removal in Python 3.12; use importlib.util.find_spec() instead loader = importlib.find_loader(import_name) Traceback (most recent call last): File "/opt/blender-3.3.21-linux-x64/3.3/python/bin/install_requirements.py", line 77, in check_requirements if importlib.util.find_spec(import_name) is None: AttributeError: module 'importlib' has no attribute 'util'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/blender-3.3.21-linux-x64/3.3/python/bin/install_requirements.py", line 109, in
Bug Fixed
It works after I import the importlib.util in the install_requirements.py, as followsing:
#!/usr/bin/python3
import importlib
import importlib.util
import subprocess
import sys
# other codes ...
Mybe you guys can help fix this issue. Thanks.
Thank you for your report. Please take a quick look at my commit, see if it works for you.