Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: dlsym(0x7ff8574b4550, PyObjCObject_New): symbol not found #420

Closed
aleform opened this issue Nov 13, 2021 · 12 comments
Closed

Comments

@aleform
Copy link

aleform commented Nov 13, 2021

I cannot import the module on my Mac m1 Big Sur.
This is the error I get.

import pynput
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pynput/__init__.py", line 40, in <module>
    from . import keyboard
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pynput/keyboard/__init__.py", line 31, in <module>
    backend = backend(__name__)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pynput/_util/__init__.py", line 70, in backend
    return importlib.import_module('._' + module, package)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pynput/keyboard/_darwin.py", line 51, in <module>
    from pynput._util.darwin import (
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pynput/_util/darwin.py", line 60, in <module>
    OBJC.PyObjCObject_New.restype = ctypes.py_object
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x7ff8574b4550, PyObjCObject_New): symbol not found
@QingRebecca
Copy link

Any news? I have the same problem with Mac OS Monterey (M1 Pro chip)

@anthonyaoun23
Copy link

Me as well, on a macbook pro 2015 Mac OS Monterey. No luck finding a fix yet, but same exact error.

@Pedro-Beirao
Copy link

It was working fine yesterday, but I decided to upgrade from 1.7.3 to 1.7.4, and not I get this error
Tried downgrading, but the problem doesnt go away.

MacOS Monterey - M1 MacBook pro

@Pedro-Beirao
Copy link

I think the problem is that pyobjc (https://github.com/ronaldoussoren/pyobjc) was updated a few days ago.
I will write back if I get it to work

@aleform
Copy link
Author

aleform commented Nov 14, 2021

Thanks @Pedro-Beirao! The problem is pyojc I downgraded to 7.3 and seems to work

@Pedro-Beirao
Copy link

Pedro-Beirao commented Nov 14, 2021

Downgrading pyobjc to 7.3 also worked for me

@moses-palmer
Copy link
Owner

Thank you for your report.

I can reproduce this on a non-M1 mac, and it seems to be caused by changes to pyobjc. I hade made a small change and pushed the fix to master.

@markthompson94
Copy link

After downgrading pyobjc to 7.3, I get the below error;

  File "/Users/xxxxxxxxx/xxxx/xxxxx/lib/python3.8/site-packages/HIServices/init.py", line 11, in
    from HIServices import _metadata, _HIServices
RuntimeError: Wrong version of PyObjC C API (got 21, expected 22)

Has anyone else seen this / does any have a solution?

Are there modules with dependencies on PyObjC that also require downgrading?

Thanks,
Mark

@moses-palmer
Copy link
Owner

Please try the updated version of pynput instead; install from the master branch.

@markthompson94
Copy link

Do you know when we might be able to expect the fix included in a PyPi release?

Thanks,
Mark

@willwade
Copy link

willwade commented Jul 4, 2022

Just to save anyone else the google:

pip install --upgrade pyobjc==7.3

Fixes this

@JeremyKeusters
Copy link

In case anyone still bumps into this, simply upgrading to pynput==1.7.6 does the trick now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants