Blender Python command gives error in Apple Silicon build and not Intel build #100236

Closed
opened 2022-08-05 22:37:22 +02:00 by Joel Godin · 10 comments

System Information
Operating system: macOS Monterrey 12.5
Graphics card: Apple M1

Blender Version
Broken: 3.1 - 3.4 Alpha (including LTS)
Worked: 3.0.1

Short description of error
blender python error in Arm and Apple Silicon builds, but not Intel builds.

Exact steps for others to reproduce the error
This error was in an addon, whittled it down to this one python command.
There is another error in this addon for Apple Silicon, but have not traced it down to something simple yet. So I have to use the Intel build on my M1 build.

  1. on Apple M1 go to python console
  2. type in :
    import bpy
    bpy.ops.export_scene.obj

Throws following error on Apple Silicon builds

import bpy
bpy.ops.export_scene.obj

Traceback (most recent call last):

File "/Applications/Blender/Blender3.2.2.app/Contents/Resources/3.2/python/lib/python3.10/code.py", line 90, in runcode
  exec(code, self.locals)
File "<blender_console>", line 1, in <module>
File "/Applications/Blender/Blender3.2.2.app/Contents/Resources/3.2/scripts/modules/bpy/ops.py", line 131, in __repr__
  return _op_as_string(self.idname())

AttributeError: _bpy.ops.as_string: operator "EXPORT_SCENE_OT_obj" could not be found

**System Information** Operating system: macOS Monterrey 12.5 Graphics card: Apple M1 **Blender Version** Broken: 3.1 - 3.4 Alpha (including LTS) Worked: 3.0.1 **Short description of error** blender python error in Arm and Apple Silicon builds, but not Intel builds. **Exact steps for others to reproduce the error** This error was in an addon, whittled it down to this one python command. There is another error in this addon for Apple Silicon, but have not traced it down to something simple yet. So I have to use the Intel build on my M1 build. 1) on Apple M1 go to python console 2) type in : import bpy bpy.ops.export_scene.obj ***Throws following error on Apple Silicon builds*** >>> import bpy >>> bpy.ops.export_scene.obj Traceback (most recent call last): ``` File "/Applications/Blender/Blender3.2.2.app/Contents/Resources/3.2/python/lib/python3.10/code.py", line 90, in runcode exec(code, self.locals) File "<blender_console>", line 1, in <module> File "/Applications/Blender/Blender3.2.2.app/Contents/Resources/3.2/scripts/modules/bpy/ops.py", line 131, in __repr__ return _op_as_string(self.idname()) ``` AttributeError: _bpy.ops.as_string: operator "EXPORT_SCENE_OT_obj" could not be found
Author

Added subscriber: @FloridaJo

Added subscriber: @FloridaJo
Member

Added subscriber: @Alaska

Added subscriber: @Alaska
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

I personally can not reproduce the issue with the system information found below.

Maybe I'm not doing something right. Am I supposed to fill out the bpy.ops.export_scene.obj command with information like bpy.ops.export_scene.obj(filepath="/folder/file"...) or is the command given enough to cause the issue?

System Information
Operating system: macOS-12.5-arm64-arm-64bit 64 Bits
Processor: Apple M1 Pro Apple 4.1 Metal - 76.3
Blender version: 3.2.1 (Compiled for ARM/Apple Silicon)
Blender version: 3.4.0 Alpha, branch: master, commit date: 2022-08-03 01:27, hash: 84b1607196 (Compiled for ARM/Apple Silicon)

I personally can not reproduce the issue with the system information found below. Maybe I'm not doing something right. Am I supposed to fill out the `bpy.ops.export_scene.obj` command with information like `bpy.ops.export_scene.obj(filepath="/folder/file"...)` or is the command given enough to cause the issue? **System Information** Operating system: macOS-12.5-arm64-arm-64bit 64 Bits Processor: Apple `M1` Pro Apple 4.1 Metal - 76.3 Blender version: 3.2.1 (Compiled for ARM/Apple Silicon) Blender version: 3.4.0 Alpha, branch: master, commit date: 2022-08-03 01:27, hash: `84b1607196` (Compiled for ARM/Apple Silicon)
Author

It's pretty well explained above:
on Apple M1 go to python console
type in :
import bpy
bpy.ops.export_scene.obj

It's pretty well explained above: on Apple M1 go to python console type in : import bpy bpy.ops.export_scene.obj
Author

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

Added subscriber: @deadpin

Added subscriber: @deadpin

I can get a similar trace on Windows when the .OBJ addon is disabled in user preferences (User Preferences -> Addons -> Import-Export: Wavefront OBJ format (legacy)):

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "C:\Users\jesse\source\blender-git\build-full\bin\RelWithDebInfo\3.4\scripts\modules\bpy\ops.py", line 129, in __repr__
    return _op_as_string(self.idname())
AttributeError: _bpy.ops.as_string: operator "EXPORT_SCENE_OT_obj" could not be found

That error in such a situation is expected. Can you check and see if that might be the case for you? If so, you might have to help investigate why that addon was disabled for you - it should be enabled by Default. Did you try to transfer settings from an older version or similar?

I can get a similar trace on Windows when the .OBJ addon is disabled in user preferences (`User Preferences` -> `Addons` -> `Import-Export: Wavefront OBJ format (legacy)`): ``` Traceback (most recent call last): File "<blender_console>", line 1, in <module> File "C:\Users\jesse\source\blender-git\build-full\bin\RelWithDebInfo\3.4\scripts\modules\bpy\ops.py", line 129, in __repr__ return _op_as_string(self.idname()) AttributeError: _bpy.ops.as_string: operator "EXPORT_SCENE_OT_obj" could not be found ``` That error in such a situation is expected. Can you check and see if that might be the case for you? If so, you might have to help investigate why that addon was disabled for you - it should be enabled by Default. Did you try to transfer settings from an older version or similar?
Author

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Joel Godin self-assigned this 2022-08-06 22:42:57 +02:00
Author

@deadpin That was it. Not sure why it was unchecked, but yes, I often transfer settings from an older version.
thanks a bunch

@deadpin That was it. Not sure why it was unchecked, but yes, I often transfer settings from an older version. thanks a bunch
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#100236
No description provided.