btrack: Cannot load dylib on Intel macbooks
From Ania:
1.4 GHz Intel Core i5
File /opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/libwrapper.py:84, in load_library(filename)
83 try:
---> 84 lib = ctypes.cdll.LoadLibrary(full_lib_file)
85 logger.info(f"Loaded btrack: {full_lib_file}")
File /opt/anaconda3/envs/btrack-env/lib/python3.10/ctypes/__init__.py:452, in LibraryLoader.LoadLibrary(self, name)
451 def LoadLibrary(self, name):
--> 452 return self._dlltype(name)
File /opt/anaconda3/envs/btrack-env/lib/python3.10/ctypes/__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
373 if handle is None:
--> 374 self._handle = _dlopen(self._name, mode)
375 else:
OSError: dlopen(/opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/libs/libtracker.dylib, 6): no suitable image found. Did find:
/opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/libs/libtracker.dylib: cannot load 'libtracker.dylib' (load command 0x80000034 is unknown)
/opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/libs/libtracker.dylib: cannot load 'libtracker.dylib' (load command 0x80000034 is unknown)
The above exception was the direct cause of the following exception:
OSError Traceback (most recent call last)
Cell In[12], line 1
----> 1 with btrack.BayesianTracker() as tracker:
2
3 # configure the tracker using a config file
4 tracker.configure(cfg)
5 tracker.max_search_radius = 20
File /opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/core.py:130, in BayesianTracker.__init__(self, verbose)
128 # load the library, get an instance of the engine
129 self._initialised = False
--> 130 self._lib = libwrapper.get_library()
131 self._engine = self._lib.new_interface(verbose)
133 if not verbose:
File /opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/libwrapper.py:94, in get_library()
92 def get_library(): # noqa: PLR0915
93 """Loads and returns the btrack shared library."""
---> 94 lib = load_library(os.path.join(BTRACK_PATH, "libs", "libtracker"))
96 # deal with constructors/destructors
97 lib.new_interface.restype = ctypes.c_void_p
File /opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/libwrapper.py:87, in load_library(filename)
85 logger.info(f"Loaded btrack: {full_lib_file}")
86 except OSError as err:
---> 87 raise OSError(f"Cannot load shared library {full_lib_file}") from err
89 return lib
OSError: Cannot load shared library /opt/anaconda3/envs/btrack-env/lib/python3.10/site-packages/btrack/libs/libtracker.dylib
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (7 by maintainers)
Also @paddyroddy - I just tried a fresh install (btrack 0.5.13 from pypi) on:
…and everything seemed to work ok.
I went down a self inflicted sort-of-related rabbit hole this evening (courtesy of @paddyroddy 😉), and while I was down there at one point I was getting errors like:
I think this means
btrack
is using c++ calls only available in macOS >= 10.15, so it won’t work with macOS < 10.15.