andrewssobral / andrewssobral/bgslibrary

Importing python library on M1 chip MacOS

Ouverte
#209 1 commentaire 1 réaction 1 personne assignée Réclamée par @andrewssobral Voir sur GitHub
bug to fix to investigate
Langage dominant
C++
Étoiles
2.3k
Forks
735
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi @andrewssobral,

I am having issues importing the python library with M1 chip MacOS. It seems to be related to the architecture of my machine. I describe my environment and how to reproduce the bug does below:

I have compiled bgslibrary with support for Python on MacOS as stated in https://github.com/andrewssobral/bgslibrary/wiki/Wrapper:-Python. The code compiled well using a Conda environment with the following installations:
-OpenCV 3.4.7
-Python 3.8.6 (Anaconda)

Compilation was done with:
cmake -D BGS_PYTHON_SUPPORT=ON ..

Then, I added the generated lib (pybgs.cpython-39-darwin.so) to my Python path:
export PYTHONPATH="${PYTHONPATH}:/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/build"

When try to run the demo with the command python demo.py, I get the following error:

Traceback (most recent call last):
File "/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/demo.py", line 3, in
import pybgs as bgs
ImportError: dlopen(/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/build/pybgs.cpython-39-darwin.so, 0x0002): tried: '/Users/xavibou/Documents/repos/change_detection/methods/bgslibrary/build/pybgs.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/pybgs.cpython-39-darwin.so' (no such file), '/usr/lib/pybgs.cpython-39-darwin.so' (no such file)

Thank you,
Xavi

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.