M1 mac: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e') - python
34
votes
8
answers
153808
views
When I try to run "scrapy startproject" in vscode, below error comes up.
Traceback (most recent call last):
File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/bin/scrapy", line 5, in
from scrapy.cmdline import execute
File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/lib/python3.9/site-packages/scrapy/__init__.py", line 12, in
from scrapy.spiders import Spider
File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/lib/python3.9/site-packages/scrapy/spiders/__init__.py", line 11, in
from scrapy.http import Request
File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/lib/python3.9/site-packages/scrapy/http/__init__.py", line 11, in
from scrapy.http.request.form import FormRequest
File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/lib/python3.9/site-packages/scrapy/http/request/form.py", line 10, in
import lxml.html
File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/lib/python3.9/site-packages/lxml/html/__init__.py", line 53, in
from .. import etree
ImportError: dlopen(/Users/admin/Desktop/development/project/scrapyTutorial/venv/lib/python3.9/site-packages/lxml/etree.cpython-39-darwin.so, 0x0002): tried: '/Users/admin/Desktop/development/project/scrapyTutorial/venv/lib/python3.9/site-packages/lxml/etree.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/etree.cpython-39-darwin.so' (no such file), '/usr/lib/etree.cpython-39-darwin.so' (no such file)
And then I figure out that, the "mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')"is the main promblem. I tried with https://github.com/nmwsharp/robust-laplacians-py/issues/7 and I tried to uninstall the old packages and install it again using arch -arm64 pip install Scrapy.
But it didn't work...
So...how to fix this problem...?
Asked by Ryan
(443 rep)
Feb 11, 2022, 12:44 AM
Last activity: Aug 22, 2024, 12:32 PM
Last activity: Aug 22, 2024, 12:32 PM