New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64') #3171
Comments
(lovenv) malinamedusa@MacBook-Pro test-task-for-Aero % python3 load_data_in_table.py During handling of the above exception, another exception occurred: Traceback (most recent call last): I have the same problem although I have arm64 |
I got the same issue |
These don't appear to be problems with NLTK. The first is a problem with regex and the second is a problem with charset_normalizer which is a dependency of requests. And for both of the issue appears to be that you're running python under rosetta 2 but had installed the libraries in native apple silicon mode, or vice versa. Do you get these same errors with a fresh install of python and NLTK? |
Mac version: MacBook Pro M1 2020
MacOS: 13.4.1
python version: 3.11.3
Traceback (most recent call last):
File "/Users/hyx020222/Library/Mobile Documents/com
appleCloudDocs/project/NLP/main.py", line 1, inimport nltk
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/nltk/init.py", line 138, in
from nltk.text import *
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/nltk/text.py", line 29, in
from nltk.tokenize import sent_tokenize
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/nltk/tokenize/init.py", line 65, in
from nltk.tokenize.casual import TweetTokenizer, casual_tokenize
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/nltk/tokenize/casual.py", line 49, in
import regex # #2409
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/regex/init.py", line 1, in
from .regex import *
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/regex/regex.py", line 421, in
import regex._regex_core as _regex_core
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/regex/_regex_core.py", line 21, in
import regex._regex as _regex
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/regex/_regex.cpython-311-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/regex/_regex.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/regex/_regex.cpython-311-darwin.so' (no such file), '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/regex/_regex.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
The text was updated successfully, but these errors were encountered: