Giter Club home page Giter Club logo

Comments (9)

SergeiAlonichau avatar SergeiAlonichau commented on May 18, 2024 3

Looking into it.

from blingfire.

jialigit avatar jialigit commented on May 18, 2024 2

I also find this problem of not supporting macOs platform. Really hope for the open source of it.

from blingfire.

SergeiAlonichau avatar SergeiAlonichau commented on May 18, 2024 2

from blingfire.

ma2rten avatar ma2rten commented on May 18, 2024 1

Same problem:

$ python3 -m virtualenv env
Using base prefix '/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7'
/Users/bosma/Library/Python/3.7/lib/python/site-packages/virtualenv.py:1041: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
New python executable in /Users/bosma/projects/env/bin/python3.7
Also creating executable in /Users/bosma/projects/env/bin/python
Installing setuptools, pip, wheel...done.
$ source env/bin/activate
$ pip install blingfire
Collecting blingfire
Downloading https://files.pythonhosted.org/packages/6b/aa/f999e3ca3e826cbdefe7dea7f90baf06db26448ef4cfd80f4800d84d660f/blingfire-0.0.9-py3-none-any.whl (248kB)
|████████████████████████████████| 256kB 1.5MB/s
Installing collected packages: blingfire
Successfully installed blingfire-0.0.9
$ python
Python 3.7.0 (default, Aug 17 2018, 21:14:48)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from blingfire import *
Traceback (most recent call last):
File "", line 1, in
File "/Users/bosma/projects/env/lib/python3.7/site-packages/blingfire/init.py", line 5, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'
text = 'This is the Bling-Fire tokenizer'
output = text_to_words(text)
KeyboardInterrupt

$ pip install numpy
Collecting numpy
Downloading https://files.pythonhosted.org/packages/43/6e/71a3af8680a159a141fab5b4d19988111a09c02ffbfdeb42175cca0fa341/numpy-1.16.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (13.9MB)
|████████████████████████████████| 13.9MB 2.1MB/s
Installing collected packages: numpy
Successfully installed numpy-1.16.3
$ python
Python 3.7.0 (default, Aug 17 2018, 21:14:48)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from blingfire import *
text = 'This is the Bling-Fire tokenizer'
output = text_to_words(text)
Traceback (most recent call last):
File "", line 1, in
File "/Users/bosma/projects/env/lib/python3.7/site-packages/blingfire/init.py", line 58, in text_to_words
o_len = blingfire.TextToWords(c_char_p(s_bytes), c_int(len(s_bytes)), byref(o_bytes), c_int(o_bytes_count))
AttributeError: 'NoneType' object has no attribute 'TextToWords'

from blingfire.

sandeepeecs avatar sandeepeecs commented on May 18, 2024

Looking into it.

Any suggested fixes to make it work no macOS?

from blingfire.

ZPVIP avatar ZPVIP commented on May 18, 2024

there is no mac OS support:

# detect windows
if platform.system() == "Windows":
blingfire = cdll.LoadLibrary(os.path.join(path, "blingfiretokdll.dll"))
# detect Mac OSX
elif platform.system() == "Darwin":
pass
else:
# detect linux
blingfire = cdll.LoadLibrary(os.path.join(path, "libblingfiretokdll.so"))

from blingfire.

ankane avatar ankane commented on May 18, 2024

fwiw, I was able to get it working on Mac with the following changes: master...ankane:mac. There's probably a cleaner way to do it.

from blingfire.

SergeiAlonichau avatar SergeiAlonichau commented on May 18, 2024

Thank you, Andrew, for doing the change!

Starting from version 0.0.16 blingfire package supports Mac.

from blingfire.

ankane avatar ankane commented on May 18, 2024

Awesome, thanks @SergeiAlonichau!

from blingfire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.