Release Candidate Blender 2.80 can't import addons

Hi @brecht, I’ve had a user of our addon point out that on MacOS there appears to be a problem importing any addons, including ours. I can successfully run 2.80.74 (build hash - bbb3500c9716). But when I run the RC ( which I noticed has been released as a .dmg) version, I get this when I attempt to run blender with certain addons (including our Crowdrender addon) enabled.

jimbosmaccypro:MacOS jamescrowther$ ./Blender 
Read prefs: /Users/jamescrowther/Library/Application Support/Blender/2.80/config/userpref.blend
found bundled python: /Applications/Blender.app/Contents/Resources/2.80/python
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 351, in enable
mod = __import__(module_name)
  File "/Applications/Blender.app/Contents/Resources/2.80/scripts/addons/io_scene_gltf2/__init__.py", line 63, in <module>
from io_scene_gltf2.io.exp import gltf2_io_draco_compression_extension
  File "/Applications/Blender.app/Contents/Resources/2.80/scripts/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py", line 17, in <module>
from ctypes import *
  File "/Applications/Blender.app/Contents/Resources/2.80/python/lib/python3.7/ctypes/__init__.py", line 543, in <module>
_reset_cache()
  File "/Applications/Blender.app/Contents/Resources/2.80/python/lib/python3.7/ctypes/__init__.py", line 273, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError
Exception in module register(): /Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/__init__.py
Traceback (most recent call last):
  File "/Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/src/py_3_7/__init__.py", line 72, in <module>
import bpy, imp, subprocess, sys, os, zmq
  File "/Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/lib/Darwin/3_7/zmq/__init__.py", line 42, in <module>
_load_libzmq()
  File "/Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/lib/Darwin/3_7/zmq/__init__.py", line 9, in _load_libzmq
import sys, ctypes, platform, os
  File "/Applications/Blender.app/Contents/Resources/2.80/python/lib/python3.7/ctypes/__init__.py", line 543, in <module>
_reset_cache()
  File "/Applications/Blender.app/Contents/Resources/2.80/python/lib/python3.7/ctypes/__init__.py", line 273, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.80/scripts/modules/addon_utils.py", line 384, in enable
mod.register()
  File "/Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/__init__.py", line 119, in register
cr_source.register()
  File "/Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/src/__init__.py", line 89, in register
select_versions()
  File "/Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/src/__init__.py", line 69, in select_versions
from . import py_3_7 as cr_version
  File "/Users/jamescrowther/Library/Application Support/Blender/2.80/scripts/addons/crowdrender/src/py_3_7/__init__.py", line 96, in <module>
raise ImportError("CrowdRender is not able to run because it can't import necessary"+\
ImportError: CrowdRender is not able to run because it can't import necessarycomponents, please e-mail us at [email protected] to report this.

It seems multiple addons are affected as well, from a cursory inspection, any addon that uses ctypes seems to be affected. I’ve verified this by running the following command in the blender 2.8 RC’s scripting environment;

import ctypes
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "/Applications/Blender.app/Contents/Resources/2.80/python/lib/python3.7/ctypes/__init__.py", line 543, in <module>
_reset_cache()
  File "/Applications/Blender.app/Contents/Resources/2.80/python/lib/python3.7/ctypes/__init__.py", line 273, in _reset_cache
CFUNCTYPE(c_int)(lambda: None)
MemoryError

Finally there is a workaround that the user who reported this has discovered for MacOs, but it appears to involve disabling the system integrity protection which I don’t fully understand the consequences of and am hesitant to recommend as a long term solution.

Bottom line is we think there is a bug. Addons, including ours were fine in the bbb3500c9716 build, the release candidate can’t run certain addons now and can’t import ctypes. Should I go ahead and write a bug report?

James

There was a code signing issue in the build, the latest download should have it fixed.
https://developer.blender.org/T66754

This may be the same issue.

Hi Brecht, I am going to try downloading the release candidate again today and see if its fixed. Though after reading through the description and comments of that bug, I see that there are others with the same issue I have still complaining that the fix that satisfied most of those problems, didn’t fix this particular issue.
I’ll post the workaround here, with a warning about its implications shortly. I’ll report back soon with the status on whether the latest RC has a fix for this.

Thanks :slight_smile:

Hi @brecht, I have downloaded the RC just now, build hash 06312c6d2db8. It still has a memory error showing when attempting to run addons that depend on ctypes. Also can’t directly import ctypes, I get the same error as above.

So, shall I raise a new bug for this?

I am facing a similar MemoryError issue on macOS when I try to enable/re-install certain addons with 2.8 RC (build: 2.80 2019-07-11).

This issue doesn’t reproduce when using a recent Beta build (July-6th), which is strange because API should have freezed at this point.

I will test latest release and report back.

Pie Menu Editor

QBlocker

Some addons are not affected by this.

27

I’ve written up a workaround that someone has posted on our forum. I’ve tested it, it does work, however it involves disabling the Macintosh System Integrity Protection. So its a workaround that may not suit everyone.

Here’s a link. Hoping that we can get a fix for this since soon.

Thx; disable SIP isn’t something normal users should do. Not unless you are loading custom kext…

Agree, its not for everyone, but its the only workaround that works atm.

I guess technically there is another workaround:

Download the latest beta build, it’s unsigned, hence your addons will work just fine…

Until T66986 is resolved I don’t think signed RC build will work with these addons with macOS SIP.

https://developer.blender.org/T66986

1 Like

Yeah good idea, this will work fine, I’ll add this to the blog post. This is much better for those wishing to use the latest beta. Also Brecht has made an issue for this to be fixed over at developer.blender.org, so they are aware this is an issue that needs to be fixed.