macOS: addons fail to import due to Python 3.9 libraries linking against libz.dylib #85648

Closed
opened 2021-02-15 12:20:55 +01:00 by Piotr Nikov · 36 comments

System Information
Operating system: MacOs 11.2
Graphics card: AMD Radeon Pro 5500M 8 GB

Blender Version
Broken: MacOs 2.93
Worked: 2.92 and Win10 2.93

Short description of error
Addon Rigify won't load with 2.93 MacOs version.
Exact steps for others to reproduce the error
Run import binascii in Blender.
Screenshot 2021-02-15 at 12.12.09.png
Or

Python: Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.93/scripts/startup/bl_operators/userpref.py", line 609, in execute
    import zipfile
  File "/Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/zipfile.py", line 6, in <module>
    import binascii
ImportError: dlopen(/Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so, 2): Library not   loaded: libz.1.dylib
  Referenced from: /Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so
  Reason: unsafe use of relative rpath libz.1.dylib in /Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so with restricted binary

Win10 version works fine.
Thanks!

Piotr

**System Information** Operating system: MacOs 11.2 Graphics card: AMD Radeon Pro 5500M 8 GB **Blender Version** Broken: MacOs 2.93 Worked: 2.92 and Win10 2.93 **Short description of error** Addon Rigify won't load with 2.93 MacOs version. **Exact steps for others to reproduce the error** Run `import binascii` in Blender. ![Screenshot 2021-02-15 at 12.12.09.png](https://archive.blender.org/developer/F9803952/Screenshot_2021-02-15_at_12.12.09.png) Or ``` Python: Traceback (most recent call last): File "/Applications/Blender.app/Contents/Resources/2.93/scripts/startup/bl_operators/userpref.py", line 609, in execute import zipfile File "/Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/zipfile.py", line 6, in <module> import binascii ImportError: dlopen(/Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so, 2): Library not loaded: libz.1.dylib Referenced from: /Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so Reason: unsafe use of relative rpath libz.1.dylib in /Applications/Blender.app/Contents/Resources/2.93/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so with restricted binary ```` Win10 version works fine. Thanks! Piotr
Author

Added subscriber: @Pyer

Added subscriber: @Pyer

#85801 was marked as duplicate of this issue

#85801 was marked as duplicate of this issue

#85624 was marked as duplicate of this issue

#85624 was marked as duplicate of this issue

#85757 was marked as duplicate of this issue

#85757 was marked as duplicate of this issue
Author

Ok I found a workaround. It's a Mac security issue.
When I disable the Mac's SIP (System Integrity Protection), I can load the Addon without any errors and everything works as expected.
I have no clue how to solve this at a Blender (Rigify?) level. Can anyone help? I'm not sure it's a good idea to lower the system's security to be able to run an addon...

Ok I found a workaround. It's a Mac security issue. When I disable the Mac's SIP (System Integrity Protection), I can load the Addon without any errors and everything works as expected. I have no clue how to solve this at a Blender (Rigify?) level. Can anyone help? I'm not sure it's a good idea to lower the system's security to be able to run an addon...
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

Related: #85624 (Animation Nodes ; macOS Big Sur ; python 3.9.0)

Related: #85624 (Animation Nodes ; macOS Big Sur ; python 3.9.0)
Author

In #85648#1112689, @ankitm wrote:
Related: #85624 (Animation Nodes ; macOS Big Sur ; python 3.9.0)

Ah great! I tried searching for similar issues but failed miserably. Thanks @ankitm !

> In #85648#1112689, @ankitm wrote: > Related: #85624 (Animation Nodes ; macOS Big Sur ; python 3.9.0) Ah great! I tried searching for similar issues but failed miserably. Thanks @ankitm !
Member

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

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

Does a new build from https://builder.blender.org/download/ fix this issue ?

Does a new build from https://builder.blender.org/download/ fix this issue ?
Author

Added subscriber: @Ankit-1

Added subscriber: @Ankit-1
Author

@Ankit-1 Meel (ankitm)
Nope sorry. The latest nightly gives me the same error (related to Python?). I have to disable the mac's SIP to access the addon...

@Ankit-1 Meel (ankitm) Nope sorry. The latest nightly gives me the same error (related to Python?). I have to disable the mac's SIP to access the addon...
Member

Could you share the output of xattr -l -r /Applications/Blender.app ?

Could you share the output of `xattr -l -r /Applications/Blender.app` ?
Author

Sure! Here are two outputs from two machines (working and non-working). In case it's helpful...Output_With_SIP_NotWorking.txt

Output_Without_SIP_Working.txt

Sure! Here are two outputs from two machines (working and non-working). In case it's helpful...[Output_With_SIP_NotWorking.txt](https://archive.blender.org/developer/F9814774/Output_With_SIP_NotWorking.txt) [Output_Without_SIP_Working.txt](https://archive.blender.org/developer/F9814775/Output_Without_SIP_Working.txt)
Member

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

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

Added subscriber: @sebbas

Added subscriber: @sebbas
Member
$ otool -l /usr/lib/libz.1.dylib
/usr/lib/libz.1.dylib:
...
Load command 3
          cmd LC_ID_DYLIB
      cmdsize 48
         name /usr/lib/libz.1.dylib (offset 24)
   time stamp 1 Thu Jan  1 05:30:01 1970
      current version 1.2.11
compatibility version 1.0.0
...

The ID of libz seems correct.. so not sure why our library has a relative rpath ?

$ otool -L "/Users/ankitkumar/blender-build/lib/darwin/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so"
/Users/ankitkumar/blender-build/lib/darwin/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so:
	libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)

The hotfix is install_name_tool -change ... but would be nice to fix cmake builder somehow.
CC @sebbas

``` $ otool -l /usr/lib/libz.1.dylib /usr/lib/libz.1.dylib: ... Load command 3 cmd LC_ID_DYLIB cmdsize 48 name /usr/lib/libz.1.dylib (offset 24) time stamp 1 Thu Jan 1 05:30:01 1970 current version 1.2.11 compatibility version 1.0.0 ... ``` The ID of libz seems correct.. so not sure why our library has a relative rpath ? ``` $ otool -L "/Users/ankitkumar/blender-build/lib/darwin/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so" /Users/ankitkumar/blender-build/lib/darwin/python/lib/python3.9/lib-dynload/binascii.cpython-39-darwin.so: libz.1.dylib (compatibility version 1.0.0, current version 1.2.11) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1) ``` The hotfix is `install_name_tool -change ...` but would be nice to fix cmake builder somehow. CC @sebbas
@ankitm Interesting .. not yet sure if it's is related to the issue but this looks odd to me: https://developer.blender.org/diffusion/BL/browse/trunk/lib/darwin/python/lib/python3.9/site-packages/Cython-0.29.21-py3.9.egg-info/SOURCES.txt$18

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3
Member

Added subscribers: @CookItOff, @StephenSwaney

Added subscribers: @CookItOff, @StephenSwaney
Member

Added subscribers: @Luison, @EAW

Added subscribers: @Luison, @EAW
Member

I think this is a side effect of c70eb30240
macOS Python libraries should either link statically against zlib with a patch like that of linux, or use the system installation of Zlib.
Still need to build python to see if removing that dependency and those flags helps this issue.

I think this is a side effect of c70eb30240 macOS Python libraries should either link statically against zlib with a patch like that of linux, or use the system installation of Zlib. Still need to build python to see if removing that dependency and those flags helps this issue.
Member

Removed subscriber: @Ankit-1

Removed subscriber: @Ankit-1
Member

Still need to build python to see if removing that dependency and those flags helps this issue.

Or reuse the patch to see if Python stays happy with libz_pic.a.

> Still need to build python to see if removing that dependency and those flags helps this issue. Or reuse the patch to see if Python stays happy with libz_pic.a.
Member

Added subscriber: @randum

Added subscriber: @randum

@ankitm Thanks for merging my report. I was aware of this one here, but thought a more generalized phrasing would draw more attention to, what looks like a very pressing issue.
If you think it makes sense, maybe rename this one here to reflect that?
Anyway, thanks for the fix, hope it gets committed quickly!

@ankitm Thanks for merging my report. I was aware of this one here, but thought a more generalized phrasing would draw more attention to, what looks like a very pressing issue. If you think it makes sense, maybe rename this one here to reflect that? Anyway, thanks for the fix, hope it gets committed quickly!
Ankit Meel changed title from Rigify not loading with latest MacOs 2.93 nightlies to macOS: addons fail to import due to Python 3.9 libraries linking against libz.dylib 2021-02-20 12:10:12 +01:00

This issue was referenced by 9fe53bd4a1

This issue was referenced by 9fe53bd4a1ac0eaa63fcf1ebd151fe4db0411b49
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Ankit Meel self-assigned this 2021-02-23 04:14:15 +01:00
Member

Changed status from 'Resolved' to: 'Confirmed'

Changed status from 'Resolved' to: 'Confirmed'
Member

Actually it will be resolved after libraries are committed https://developer.blender.org/diffusion/BL/history/trunk/lib/

Actually it will be resolved after libraries are committed https://developer.blender.org/diffusion/BL/history/trunk/lib/
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Member
https://developer.blender.org/rBL62584

Added subscriber: @shannonz-1

Added subscriber: @shannonz-1

I just discovered this issue today for OS Linux/Manjaro -- cannot [install...] any addons from .zip file. This is currently affecting all blender versions I have tried:

2.83.9

2.91.0

2.91.2 (Date 2021-01-19 16:15, Hash: 5be9ef4177, Branch: master)
PYTHON INTERACTIVE CONSOLE 3.9.1 (default, Feb 6 2021, 06:49:13) [GCC 10.2.0]

2.92.0 (release) (Date: 2021-02-24 1625, Hash: 02948a2cab, Branch: master)
PYTHON INTERACTIVE CONSOLE 3.7.7 (default, Jul 9 2020, 12:52:49) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]

2.93.0 alpha build (Date: 2021-02-27 20:22, Hash: 92743cc895, Branch: master)
PYTHON INTERACTIVE CONSOLE 3.9.2 (default, Feb 25 2021, 12:19:39) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]

system-info.txt system-info.txt from 2.93.0 alpha build

...
have the libraries been committed yet? (as mentioned by Ankit Meel, above)

I just discovered this issue today for OS Linux/Manjaro -- cannot [install...] any addons from .zip file. This is currently affecting all blender versions I have tried: 2.83.9 2.91.0 2.91.2 (Date 2021-01-19 16:15, Hash: 5be9ef417703, Branch: master) PYTHON INTERACTIVE CONSOLE 3.9.1 (default, Feb 6 2021, 06:49:13) [GCC 10.2.0] 2.92.0 (release) (Date: 2021-02-24 1625, Hash: 02948a2cab44, Branch: master) PYTHON INTERACTIVE CONSOLE 3.7.7 (default, Jul 9 2020, 12:52:49) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] 2.93.0 alpha build (Date: 2021-02-27 20:22, Hash: 92743cc895dd, Branch: master) PYTHON INTERACTIVE CONSOLE 3.9.2 (default, Feb 25 2021, 12:19:39) [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] [system-info.txt](https://archive.blender.org/developer/F9849209/system-info.txt) system-info.txt from 2.93.0 alpha build ... have the libraries been committed yet? (as mentioned by Ankit Meel, above)
Member

This is currently affecting all blender versions I have tried:

Then it's not the same issue. Please file a new bug report, or search previous reports for something related.

have the libraries been committed yet?

Yes, and new Blender builds have been uploaded too. But again, yours is a different issue.

> This is currently affecting all blender versions I have tried: Then it's not the same issue. Please file a new bug report, or search previous reports for something related. > have the libraries been committed yet? Yes, and new Blender builds have been uploaded too. But again, yours is a different issue.

ok, will file a new bug report.

I followed #85801 (Any addon installation from zip will fail in Blender 2.93 (using Python 3.9.1)) to get to this (#85648). It appeared that similar bug reports were being lumped here. Sorry for my confusion.

ok, will file a new bug report. I followed [#85801](https://developer.blender.org/T85801) (Any addon installation from zip will fail in Blender 2.93 (using Python 3.9.1)) to get to this (#85648). It appeared that similar bug reports were being lumped here. Sorry for my confusion.
Thomas Dinges added this to the 2.93 LTS milestone 2023-02-07 18:46:33 +01:00
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
6 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#85648
No description provided.