FlorianRhiem / pyGLFW

Python bindings for GLFW
MIT License
232 stars 36 forks source link

M1 MacBook Conda install issue #60

Closed slerman12 closed 2 years ago

slerman12 commented 2 years ago

Installed via pip (pip install glfw) but when I run

python
>>>import glfw

I get this error:

_default_error_callback = _GLFWerrorfun(_handle_glfw_errors)
MemoryError

Not sure what's going on.

Just also tested deactivating my conda env and installing/running in a simple vanilla python virtualenv and the import worked but I need it through Conda.

Is there a conda incompatibility?

FlorianRhiem commented 2 years ago

Hey @slerman12, I do not have an M1 mac, so I have no way to check or debug directly, but I suspect it might be this issue: https://bugs.python.org/issue42688 If that's the case, you will need to use a python version containing those fixes.

Please try to run the following code, to see if this alone already causes the MemoryError:

import ctypes

@ctypes.CFUNCTYPE(None, ctypes.c_int, ctypes.c_char_p)
def test(a, b):
    print(a, b)
slerman12 commented 2 years ago

Yes, it does.

FlorianRhiem commented 2 years ago

Then I think your best bet is to check if using Python 3.10.1 fixes this issue, if you're not already using that. I can't help you otherwise, as pyGLFW is a ctypes-based wrapper and ctypes itself seems to be having this issue.