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

Import issue on MacOS M1 #171

Open
dariolamaj opened this issue May 12, 2023 · 6 comments
Open

Import issue on MacOS M1 #171

dariolamaj opened this issue May 12, 2023 · 6 comments

Comments

@dariolamaj
Copy link

Hi there,
when I'm trying to import the BlingFire library I get the following error. Any suggestions on how to fix it?
`---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Cell In[15], line 1
----> 1 from blingfire import *
3 text = 'After reading this post, you will know: What "natural language" is and how it is different from other types of data. What makes working with natural language so challenging. [1]'
5 print(text_to_sentences(text))

File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/blingfire/init.py:19
17 # detect Mac OSX
18 elif platform.system() == "Darwin":
---> 19 blingfire = cdll.LoadLibrary(os.path.join(path, "libblingfiretokdll.dylib"))
20 else:
21 # detect linux
22 blingfire = cdll.LoadLibrary(os.path.join(path, "libblingfiretokdll.so"))

File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/init.py:454, in LibraryLoader.LoadLibrary(self, name)
453 def LoadLibrary(self, name):
--> 454 return self._dlltype(name)

File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/init.py:376, in CDLL.init(self, name, mode, handle, use_errno, use_last_error, winmode)
373 self._FuncPtr = _FuncPtr
375 if handle is None:
--> 376 self._handle = _dlopen(self._name, mode)
377 else:
378 self._handle = handle

OSError: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/blingfire/libblingfiretokdll.dylib, 0x0006): tried: '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/blingfire/libblingfiretokdll.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/blingfire/libblingfiretokdll.dylib' (no such file), '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/blingfire/libblingfiretokdll.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))`

@eshiofune
Copy link

same issue.

@shaibow
Copy link

shaibow commented Jun 23, 2023

up +1

@filmo
Copy link

filmo commented Jul 7, 2023

+1

1 similar comment
@aaronbriel
Copy link

+1

@anthonypuppo
Copy link

The latest distributions haven't been updated since #147 was merged. Workaround:

  1. Get the appropriate binary either by:
    • Compiling yourself by following the steps outlined here.
    • Downloading from the runtimes folder.
  2. Swap out the distributed one for the correct one you got in the previous step.

@marcinsawinski
Copy link

marcinsawinski commented Nov 16, 2024

Hi,
Are there any updates on osx? The default installation throws: libblingfiretokdll.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))
After substituting the file with one retrieved from https://github.com/microsoft/BlingFire/tree/master/nuget/lib/runtimes/osx-arm64/native/ the error messages changes to libblingfiretokdll.dylib' (not a mach-o file).

Any ideas how to fix it?

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

7 participants