neovim-remote icon indicating copy to clipboard operation
neovim-remote copied to clipboard

Not working on arm64 Mac (M1)

Open mhanberg opened this issue 3 years ago • 4 comments

I have a little script i use to save and quit all neovim instances.

On my M1 mac I am seeing this error.
Traceback (most recent call last):
  File "/Users/mitchell/Library/Python/3.9/bin/nvr", line 5, in 
    from nvr.nvr import main
  File "/Users/mitchell/Library/Python/3.9/lib/python/site-packages/nvr/__init__.py", line 1, in 
    from .nvr import main
  File "/Users/mitchell/Library/Python/3.9/lib/python/site-packages/nvr/nvr.py", line 33, in 
    import psutil
  File "/Users/mitchell/Library/Python/3.9/lib/python/site-packages/psutil/__init__.py", line 121, in 
    from . import _psosx as _psplatform
  File "/Users/mitchell/Library/Python/3.9/lib/python/site-packages/psutil/_psosx.py", line 15, in 
    from . import _psutil_osx as cext
ImportError: dlopen(/Users/mitchell/Library/Python/3.9/lib/python/site-packages/psutil/_psutil_osx.cpython-39-darwin.so, 2): no suitable image found.  Did find:
        /Users/mitchell/Library/Python/3.9/lib/python/site-packages/psutil/_psutil_osx.cpython-39-darwin.so: mach-o, but wrong architecture
        /Users/mitchell/Library/Python/3.9/lib/python/site-packages/psutil/_psutil_osx.cpython-39-darwin.so: mach-o, but wrong architecture

mhanberg avatar Apr 10 '21 08:04 mhanberg

I am running into the same issue. Anyone know of a way to get it to work on Apple Silicon?

ferdinandsalis avatar Apr 25 '21 11:04 ferdinandsalis

Unfortunately I don't have a M1, but duckduckgo suggests it's a common issue in the Python world.

Maybe you have better chances getting it solved by creating an issue for psutil instead, which is one of our dependencies.

The error says that it tries to use a Python C extension, a shared library. But that library seems to be compiled only for the "old" Intel architecture, hence the "mach-o, but wrong architecture".

So, I think this is more of a "Python3 on M1" issue than with psutil.

Suggestions:

  • The Internet says that Python 3.9.1 was the first to add experimental M1 support, so maybe just upgrading Python and then reinstalling psutil via pip is the way go.
  • If the above doesn't work, raise an issue with psutil.

mhinz avatar Apr 25 '21 15:04 mhinz

@mhinz Thank you for taking the time to answer! 🙏 will investigate.

ferdinandsalis avatar Apr 26 '21 06:04 ferdinandsalis

This seemed to get it working for me https://github.com/giampaolo/psutil/issues/1954#issuecomment-848817744

mhanberg avatar May 26 '21 15:05 mhanberg