I'm launching a web app, so I run ./setup (which is just a bash script installing all dependencies) and python manage.py runserver to launch the app.
Expected Results
No error pip installing or importing wordcloud
My packages for virtual environment show wordcloud==1.8.1, but when I try to import in python/ipython console I get the following error...
$ python
>>> import wordcloud
(marketing_py3)
rebecca@AUS-RIF-MBPM1:
$ python
Python 3.9.7 (default, Apr 20 2022, 13:45:00)
[Clang 13.1.6 (clang-1316.0.21.2.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wordcloud
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/__init__.py", line 1, in <module>
from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
File "/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/wordcloud.py", line 30, in <module>
from .query_integral_image import query_integral_image
ImportError: dlopen(/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/query_integral_image.cpython-39-darwin.so, 0x0002): tried: '/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/query_integral_image.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/query_integral_image.cpython-39-darwin.so' (no such file), '/usr/lib/query_integral_image.cpython-39-darwin.so' (no such file)
File "/Users/rebecca/apps/wordcloud/urls.py", line 3, in <module>
from .views import DashboardView
File "/Users/rebecca/apps/wordcloud/views.py", line 6, in <module>
from .utils import WordCloudCreator
File "/Users/rebecca/apps/wordcloud/utils.py", line 14, in <module>
from wordcloud import WordCloud
File "/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/__init__.py", line 1, in <module>
from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
File "/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/wordcloud.py", line 30, in <module>
from .query_integral_image import query_integral_image
ImportError: dlopen(/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/query_integral_image.cpython-39-darwin.so, 0x0002): tried: '/Users/rebecca/venv/marketing_py3/lib/python3.9/site-packages/wordcloud/query_integral_image.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/query_integral_image.cpython-39-darwin.so' (no such file), '/usr/lib/query_integral_image.cpython-39-darwin.so' (no such file)
Description
Generate Wordcloud in the Browser
Steps/Code to Reproduce
I'm launching a web app, so I run
./setup
(which is just a bash script installing all dependencies) andpython manage.py runserver
to launch the app.Expected Results
No error pip installing or importing wordcloud
My packages for virtual environment show wordcloud==1.8.1, but when I try to import in python/ipython console I get the following error...
$ python
>>> import wordcloud
Actual Results
Versions
>>> print("NumPy", numpy.__version__)
NumPy 1.21.6>>> print("matplotlib", matplotlib.__version__)
matplotlib 3.5.3$ arch
i386 (Mac M1)$ which python
/Users/rebecca/venv/marketing_py3/bin/python$ python --version
Python 3.9.7$ sw_vers
ProductName: macOS Monterrey ProductVersion: 12.2.1 BuildVersion: 21D62
Which IDE
IntelliJFramework
DjangoWhat I've tried
^^^This file does exist.
$ pip uninstall lxml
andARCHFLAGS="-arch arm64" pip install lxml --compile --no-cache-dir
. and$ pip uninstall lxml
and$ pip install --no-binary lxml lxml
according to this stackoverflow: https://apple.stackexchange.com/questions/436801/m1-mac-mach-o-file-but-is-an-incompatible-architecture-have-x86-64-need-a