Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wghou opened this issue Dec 7, 2024 · 1 comment
Assignees
Labels
confirm fix Fixed bug, waiting for confirmation of reporter.

Comments

@wghou
Copy link

wghou commented Dec 7, 2024

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.

@wghou wghou changed the title Error when run the script install_requirements.py. Blender 3.3.21 + python 3.10 Error when run the script install_requirements.py. + Blender 3.3.21 + python 3.10 Dec 7, 2024
AlpenAalAlex added a commit to AlpenAalAlex/phobos that referenced this issue Jan 16, 2025
@AlpenAalAlex
Copy link
Collaborator

Thank you for your report. Please take a quick look at my commit, see if it works for you.

@AlpenAalAlex AlpenAalAlex self-assigned this Jan 16, 2025
@AlpenAalAlex AlpenAalAlex added the confirm fix Fixed bug, waiting for confirmation of reporter. label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirm fix Fixed bug, waiting for confirmation of reporter.
Projects
None yet
Development

No branches or pull requests

2 participants