amueller / word_cloud

A little word cloud generator in Python
https://amueller.github.io/word_cloud
MIT License
10.17k stars 2.32k forks source link

Architectural problems importing with M1 Mac. #701

Closed mkacki98 closed 1 year ago

mkacki98 commented 1 year ago

Description

Troubles importing wordcloud, could that be an M1 issue?

Steps/Code to Reproduce

Code:

from wordcloud import WordCloud
import matplotlib.pyplot as plt
from PIL import Image
import numpy as np

text = ("Data science is an interdisciplinary field that uses scientific methods, processes, algorithms and systems to extract knowledge and insights from data in various forms, both structured and unstructured, similar to data")

wordcloud = WordCloud(width=1280, height=853, margin=0,
                      colormap='Blues').generate(text)

plt.imshow(wordcloud, interpolation='bilinear')
plt.axis('off')
plt.margins(x=0, y=0)
plt.show()

Expected Results

Actual Results (Error)

error-wc

Versions

versions-wc
amueller commented 1 year ago

Hey! how did you install? with conda? Sorry for the slow reply.

benson11236 commented 1 year ago

i am a new starter, i've stock in install wordcloud on my MacBook air m1 for whole day, it's so bad, I wanna go back to windows 😭😭

mkacki98 commented 1 year ago

Hi, again on my side: sorry for the lack of reply.

I created a fresh environment with python3 -m venv .venv and installed only wordcloud on Python 3.9.13 and the code pasted above did not cause any errors!

I came back to the environment I worked with when I encountered the issue, it has the following packages installed (with the same method as above, without conda) and is running Python 3.9.15:

> Package               Version
--------------------- -----------------------------
altair                4.2.0
anyio                 3.6.2
appnope               0.1.3
argon2-cffi           21.3.0
argon2-cffi-bindings  21.2.0
asttokens             2.1.0
attrs                 22.1.0
backcall              0.2.0
beautifulsoup4        4.11.1
bleach                5.0.1
blinker               1.5
blis                  0.7.9
cachetools            5.2.0
catalogue             2.0.8
certifi               2022.9.24
cffi                  1.15.1
charset-normalizer    2.1.1
click                 8.1.3
commonmark            0.9.1
confection            0.0.3
contourpy             1.0.6
cycler                0.11.0
cymem                 2.0.7
debugpy               1.6.3
decorator             5.1.1
defusedxml            0.7.1
en-core-web-sm        3.4.1
entrypoints           0.4
executing             1.2.0
fastjsonschema        2.16.2
filelock              3.8.0
fonttools             4.38.0
gitdb                 4.0.9
GitPython             3.1.29
huggingface-hub       0.11.0
idna                  3.4
importlib-metadata    5.0.0
ipykernel             6.17.1
ipython               8.6.0
ipython-genutils      0.2.0
ipywidgets            8.0.2
jedi                  0.18.2
Jinja2                3.1.2
jsonschema            4.17.1
jupyter               1.0.0
jupyter_client        7.4.7
jupyter-console       6.4.4
jupyter_core          5.0.0
jupyter-server        1.23.3
jupyterlab-pygments   0.2.2
jupyterlab-widgets    3.0.3
kiwisolver            1.4.4
langcodes             3.3.0
lxml                  4.9.1
MarkupSafe            2.1.1
matplotlib            3.6.2
matplotlib-inline     0.1.6
mistune               2.0.4
mpmath                1.2.1
murmurhash            1.0.9
nbclassic             0.4.8
nbclient              0.7.0
nbconvert             7.2.5
nbformat              5.7.0
nest-asyncio          1.5.6
networkx              3.0rc1
notebook              6.5.2
notebook_shim         0.2.2
numpy                 1.23.5
packaging             21.3
pandas                1.5.2
pandocfilters         1.5.0
parso                 0.8.3
pathy                 0.10.0
pexpect               4.8.0
pickleshare           0.7.5
Pillow                9.3.0
pip                   22.3.1
platformdirs          2.5.4
plotly                5.11.0
preshed               3.0.8
prometheus-client     0.15.0
prompt-toolkit        3.0.33
protobuf              3.20.3
psutil                5.9.4
ptyprocess            0.7.0
pure-eval             0.2.2
pyarrow               10.0.1
pycparser             2.21
pydantic              1.10.2
pydeck                0.8.0
Pygments              2.13.0
Pympler               1.0.1
pyparsing             3.0.9
pyrsistent            0.19.2
PySocks               1.7.1
python-dateutil       2.8.2
pytz                  2022.6
pytz-deprecation-shim 0.1.0.post0
PyYAML                6.0
pyzmq                 24.0.1
qtconsole             5.4.0
QtPy                  2.3.0
regex                 2022.10.31
requests              2.28.1
rich                  12.6.0
scipy                 1.9.3
seaborn               0.12.1
semver                2.13.0
Send2Trash            1.8.0
setuptools            65.6.2
six                   1.16.0
smart-open            5.2.1
smmap                 5.0.0
sniffio               1.3.0
snscrape              0.4.3.20220107.dev65+g46a6030
soupsieve             2.3.2.post1
spacy                 3.4.3
spacy-legacy          3.0.10
spacy-loggers         1.0.3
srsly                 2.4.5
stack-data            0.6.1
streamlit             1.15.1
sympy                 1.11.1
tenacity              8.1.0
terminado             0.17.0
thinc                 8.1.5
thinc-apple-ops       0.1.2
tinycss2              1.2.1
tokenizers            0.13.2
toml                  0.10.2
toolz                 0.12.0
torch                 1.14.0.dev20221123
torchaudio            0.14.0.dev20221123
torchvision           0.15.0.dev20221123
tornado               6.2
tqdm                  4.64.1
traitlets             5.5.0
transformers          4.24.0
typer                 0.7.0
typing_extensions     4.4.0
tzdata                2022.6
tzlocal               4.2
urllib3               1.26.12
validators            0.20.0
wasabi                0.10.1
wcwidth               0.2.5
webencodings          0.5.1
websocket-client      1.4.2
wheel                 0.38.4
widgetsnbextension    4.0.3
wordcloud             1.8.2.2
zipp                  3.10.0

I can confirm the bug is still there. It's probably some interactions with a package that has overwritten some other package version that causes the problem. Do you have an idea of what it could be?

mkacki98 commented 1 year ago

i am a new starter, i've stock in install wordcloud on my MacBook air m1 for whole day, it's so bad, I wanna go back to windows 😭😭

That has also been my experience with M1 so far, but I am slowly getting used to it and all the workarounds, do not lose hope!

amueller commented 1 year ago

btw there should be binaries available now on pypi.

amueller commented 1 year ago

Closing, let me know if there's still an issue!