I just bought an M2 MacBook Pro (running on Apple Silicon, Rosetta installed) and transferred my data thanks to an old TimeMachine backup. However, Python packages still are for x86 architecture.
I always get this error while using libraries like pandas, numpy or spacy:
MacBook-Pro:random_forest_keyword_extraction benoitboidin$ cd /Users/benoitboidin/Desktop/random_forest_keyword_extraction ; /usr/bin/env /usr/local/bin/python3 /Users/benoitboidin/.vscode/extensions/ms-python.python-2023.10.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 54704 -- /Users/benoitboidin/Desktop/random_forest_keyword_extraction/building_data.py
Traceback (most recent call last):
File "/Users/benoitboidin/Desktop/random_forest_keyword_extraction/building_data.py", line 5, in <module>
import spacy
File "/Users/benoitboidin/Library/Python/3.10/lib/python/site-packages/spacy/__init__.py", line 6, in <module>
from .errors import setup_default_warnings
File "/Users/benoitboidin/Library/Python/3.10/lib/python/site-packages/spacy/errors.py", line 2, in <module>
from .compat import Literal
File "/Users/benoitboidin/Library/Python/3.10/lib/python/site-packages/spacy/compat.py", line 3, in <module>
from thinc.util import copy_array
File "/Users/benoitboidin/Library/Python/3.10/lib/python/site-packages/thinc/__init__.py", line 5, in <module>
from .config import registry
File "/Users/benoitboidin/Library/Python/3.10/lib/python/site-packages/thinc/config.py", line 2, in <module>
import confection
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/confection/__init__.py", line 10, in <module>
from pydantic import BaseModel, create_model, ValidationError, Extra
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydantic/__init__.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydantic/__init__.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydantic/__init__.cpython-310-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pydantic/__init__.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
pip uninstall 'package'
then pip install 'package'
doesn't seems to work.
Any way to update or recompile everything to ARM ?