paul-nameless / pyfswatch

Python binding to libfswatch
MIT License
10 stars 9 forks source link

AttributeError: dlsym(RTLD_DEFAULT, fsw_init_library): symbol not found #2

Closed ggmartins closed 3 years ago

ggmartins commented 4 years ago
#!/usr/bin/env python
from fswatch import Monitor

monitor = Monitor()
monitor.add_path("/tmp/test/")

def callback(path, evt_time, flags, flags_num, event_num):
    print(path.decode())

monitor.set_callback(callback)
monitor.start()

produces

Traceback (most recent call last):
  File "./monitor.py", line 3, in <module>
    from fswatch import Monitor
  File "/Users/gmartins/opt/anaconda3/lib/python3.7/site-packages/fswatch/__init__.py", line 2, in <module>
    from .fswatch import Monitor
  File "/Users/gmartins/opt/anaconda3/lib/python3.7/site-packages/fswatch/fswatch.py", line 4, in <module>
    from fswatch import libfswatch
  File "/Users/gmartins/opt/anaconda3/lib/python3.7/site-packages/fswatch/libfswatch.py", line 9, in <module>
    fsw_init_library = lib.fsw_init_library
  File "/Users/gmartins/opt/anaconda3/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__
    func = self.__getitem__(name)
  File "/Users/gmartins/opt/anaconda3/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, fsw_init_library): symbol not found

on

[Python 3.7.6 ]
         Executable: /Users/gmartins/opt/anaconda3/bin/python
            Version: 3.7.6.final.0
Installation Prefix: /Users/gmartins/opt/anaconda3
      Site Packages: /Users/gmartins/opt/anaconda3/lib/python3.7/site-packages
     Implementation: CPython
             Branch: 
           Revision: 
           Compiler: Clang 4.0.1 (tags/RELEASE_401/final)
         Build Date: Jan  8 2020 13:42:34
In [7]: platform.system()                                                                                                                                                                              
Out[7]: 'Darwin'

In [8]: platform.release()                                                                                                                                                                             
Out[8]: '19.5.0'
paul-nameless commented 4 years ago

Hello, are you sure you have fswatch installed? brew install fswatch What version is it? Where is it installed (path to fswatch dylib)