I need to solve a wordcloud problem for a homework assignment.
Unfortunately, I am having a hard time getting wordcloud installed into my environment.
Here is the code I am running:
import os
import matplotlib.pyplot as plt
from wordcloud import WordCloud
I get the following error:
ImportError: No module named 'wordcloud'
Now, I know I need to use the pip install method in my command prompt to get wordcloud into my environment. Even after doing this (and trying several different destinations, including my home directory and the Anaconda3 environment), I continue to get the same error.
What am I doing wrong?
Try
python -m pip install wordcloud
You probably need numpy
and pillow
as well.
Try this on Jupyter cell:
!pip install wordcloud
this solution solved my problem which was because of different pythons on my system.
in Jupyter, run:
import sys
print(sys.executable)
to see which python you are using. copy the pass and install the wordcloud with this command from your Jupiter terminal:
path/to/python -m pip install some_package
Which in my case is:
/anaconda3/bin/python -m pip install wordcloud
and import in your code:
from wordcloud import WordCloud
The source i used: can't import
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With