Opened 5 months ago

Last modified 5 months ago

#62200 assigned defect

py39-pyglet on new mac M1: import pyglet.window fails

Reported by: gitmbgit Owned by: stromnov (Andrew Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur arm64 Cc:
Port: py-pyglet

Description (last modified by jmroot (Joshua Root))

New M1 MacBookPro running BigSur 11.2 with fresh install of macports and all python packages installed via macports:

% port installed py39-pyglet
The following ports are currently installed:
  py39-pyglet @1.5.14_0 (active)

% python3.9 -c 'import pyglet.window'            
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/window/__init__.py", line 1888, in <module>
    from pyglet.window.cocoa import CocoaWindow as Window
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/window/cocoa/__init__.py", line 44, in <module>
    from pyglet.canvas.cocoa import CocoaCanvas
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/canvas/__init__.py", line 102, in <module>
    from pyglet.canvas.cocoa import CocoaDisplay as Display
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/canvas/cocoa.py", line 41, in <module>
    from pyglet.libs.darwin.cocoapy import CGDirectDisplayID, quartz, cf
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/libs/darwin/__init__.py", line 36, in <module>
    from .cocoapy import *
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/__init__.py", line 32, in <module>
    from .runtime import objc, send_message, send_super
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1189, in <module>
    class DeallocationObserver_Implementation:
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1195, in DeallocationObserver_Implementation
    def initWithObject_(self, cmd, anObject):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1125, in decorator
    self.add_method(f, name, encoding)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1106, in add_method
    imp = add_method(self.objc_cls, name, method, encoding)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 655, in add_method
    imp = cfunctype(method)
MemoryError

Also tried in python3.8 -- same outcome. Other python graphics packages (matplotlib, pyopengl, pyobjc, tk_inter) seem to work.

Might be related to the fact that pyglet/libs/darwin/cocoapy/runtime.py refers to /usr/lib/libobjc.dylib on line 56 but no such file exists.

Change History (3)

comment:1 Changed 5 months ago by jmroot (Joshua Root)

Description: modified (diff)

comment:2 Changed 5 months ago by gitmbgit

same problem also arises in py38-llvmlite:

File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numba/core/config.py", line 16, in <module>

import llvmlite.binding as ll

File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/llvmlite/binding/init.py", line 5, in <module>

from .executionengine import *

File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/llvmlite/binding/executionengine.py", line 306, in <module>

_notify_c_hook = _ObjectCacheNotifyFunc(

MemoryError

comment:3 Changed 5 months ago by gitmbgit

Digging deeper, this seems to be a problem with ctypes.CFUNCTYPE in both cases.

Note: See TracTickets for help on using tickets.