Skip to content

Error when run the script install_requirements.py. + Blender 3.3.21 + python 3.10 #370

@wghou

Description

@wghou

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
check_requirements(optional=True, upgrade_pip=True, extra=extra)
File "/opt/blender-3.3.21-linux-x64/3.3/python/bin/install_requirements.py", line 81, in check_requirements
if not issubclass(type(loader), importlib.machinery.SourceFileLoader):
AttributeError: module 'importlib' has no attribute 'machinery'

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.

Metadata

Metadata

Assignees

Labels

confirm fixFixed bug, waiting for confirmation of reporter.merge requestedFeature waiting for merge by developers.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions