Importing wordcloud using Jupyter Notebook (Python)

最后都变了- 提交于 2019-12-24 01:45:31

问题


I am using jupyter Notebook(conda root). The python version I am running is 2.7

I am having a hard time getting wordcloud installed into my environment. Here's the code

from wordcloud import WordCloud

But I got this error:

ImportErrorTraceback (most recent call last)
<ipython-input-21-8038e19af624> in <module>()
----> 1 from wordcloud import WordCloud

C:\Users\aneeq\Anaconda2\lib\site-packages\wordcloud\__init__.py in <module>()
----> 1 from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
      2                         get_single_color_func)
      3 from .color_from_image import ImageColorGenerator
      4 
      5 __all__ = ['WordCloud', 'STOPWORDS', 'random_color_func',

C:\Users\aneeq\Anaconda2\lib\site-packages\wordcloud\wordcloud.py in <module>()
     17 from operator import itemgetter
     18 
---> 19 from PIL import Image
     20 from PIL import ImageColor
     21 from PIL import ImageDraw

C:\Users\aneeq\Anaconda2\lib\site-packages\PIL\Image.py in <module>()
     56     # Also note that Image.core is not a publicly documented interface,
     57     # and should be considered private and subject to change.
---> 58     from . import _imaging as core
     59     if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
     60         raise ImportError("The _imaging extension was built for another "

**ImportError: DLL load failed: The specified module could not be found.**

Can anyone explain what is this error? I need to use world cloud for my homework assignment


回答1:


You have problem with part of python Pillow module: with a library, that builds from _imaging.c. Try to reinstall python Pillow module from .exe package, not with pip.



来源:https://stackoverflow.com/questions/49647689/importing-wordcloud-using-jupyter-notebook-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!